diff options
Diffstat (limited to 'nuttx/sched/sig_queue.c')
-rw-r--r-- | nuttx/sched/sig_queue.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/nuttx/sched/sig_queue.c b/nuttx/sched/sig_queue.c index 3bb35c564..dee1c798a 100644 --- a/nuttx/sched/sig_queue.c +++ b/nuttx/sched/sig_queue.c @@ -2,7 +2,7 @@ * sched/sig_queue.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. - * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -44,6 +44,7 @@ #include <debug.h> #include <sched.h> #include <errno.h> + #include "os_internal.h" #include "sig_internal.h" @@ -72,20 +73,18 @@ ****************************************************************************/ /**************************************************************************** - * Function: sigqueue + * Name: sigqueue * * Description: - * This function sends the signal specified by signo with - * the signal parameter value to the process specified by - * pid. + * This function sends the signal specified by signo with the signal + * parameter value to the process specified by pid. * - * If the receiving process has the signal blocked via the - * sigprocmask, the signal will pend until it is unmasked. - * Only one pending signal (per signo) is retained. This - * is consistent with POSIX which states, "If a subsequent - * occurrence of a pending signal is generated, it is - * implementation defined as to whether the signal is - * delivered more than once." + * If the receiving process has the signal blocked via the sigprocmask, + * the signal will pend until it is unmasked. Only one pending signal (per + * signo) is retained. This is consistent with POSIX which states, "If + * a subsequent occurrence of a pending signal is generated, it is + * implementation defined as to whether the signal is delivered more than + * once." * * Parameters: * pid - Process ID of task to receive signal @@ -93,9 +92,8 @@ * value - Value to pass to task with signal * * Return Value: - * On success (at least one signal was sent), zero is - * returned. On error, -1 is returned, and errno is set - * appropriately. + * On success (at least one signal was sent), zero is returned. On + * error, -1 is returned, and errno is set appropriately: * * EGAIN The limit of signals which may be queued has been reached. * EINVAL sig was invalid. @@ -117,11 +115,11 @@ int sigqueue(int pid, int signo, void *sival_ptr) siginfo_t info; int ret = ERROR; - /* sanity checks */ + /* Sanity checks */ if (!GOOD_SIGNO(signo)) { - *get_errno_ptr() = EINVAL; + set_errno(EINVAL); return ERROR; } @@ -137,7 +135,7 @@ int sigqueue(int pid, int signo, void *sival_ptr) #endif if (pid == 0 || !stcb) { - *get_errno_ptr() = ESRCH; + set_errno(ESRCH); sched_unlock(); return ERROR; } |