diff options
Diffstat (limited to 'libc/rt')
-rw-r--r-- | libc/rt/aio.h | 54 | ||||
-rw-r--r-- | libc/rt/mqueue.h | 31 | ||||
-rw-r--r-- | libc/rt/tst-mqueue1.c | 22 |
3 files changed, 60 insertions, 47 deletions
diff --git a/libc/rt/aio.h b/libc/rt/aio.h index 35dc19642..7cfd0c110 100644 --- a/libc/rt/aio.h +++ b/libc/rt/aio.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2000,2003,2004 Free Software Foundation, Inc. +/* Copyright (C) 1996-2000,2003,2004,2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -136,25 +136,26 @@ enum /* Allow user to specify optimization. */ #ifdef __USE_GNU -extern void aio_init (__const struct aioinit *__init) __THROW; +extern void aio_init (__const struct aioinit *__init) __THROW __nonnull ((1)); #endif #ifndef __USE_FILE_OFFSET64 /* Enqueue read request for given number of bytes and the given priority. */ -extern int aio_read (struct aiocb *__aiocbp) __THROW; +extern int aio_read (struct aiocb *__aiocbp) __THROW __nonnull ((1)); /* Enqueue write request for given number of bytes and the given priority. */ -extern int aio_write (struct aiocb *__aiocbp) __THROW; +extern int aio_write (struct aiocb *__aiocbp) __THROW __nonnull ((1)); /* Initiate list of I/O requests. */ extern int lio_listio (int __mode, struct aiocb *__const __list[__restrict_arr], - int __nent, struct sigevent *__restrict __sig) __THROW; + int __nent, struct sigevent *__restrict __sig) + __THROW __nonnull ((2)); /* Retrieve error status associated with AIOCBP. */ -extern int aio_error (__const struct aiocb *__aiocbp) __THROW; +extern int aio_error (__const struct aiocb *__aiocbp) __THROW __nonnull ((1)); /* Return status associated with AIOCBP. */ -extern __ssize_t aio_return (struct aiocb *__aiocbp) __THROW; +extern __ssize_t aio_return (struct aiocb *__aiocbp) __THROW __nonnull ((1)); /* Try to cancel asynchronous I/O requests outstanding against file descriptor FILDES. */ @@ -166,26 +167,30 @@ extern int aio_cancel (int __fildes, struct aiocb *__aiocbp) __THROW; This function is a cancellation point and therefore not marked with __THROW. */ extern int aio_suspend (__const struct aiocb *__const __list[], int __nent, - __const struct timespec *__restrict __timeout); + __const struct timespec *__restrict __timeout) + __nonnull ((1)); /* Force all operations associated with file desriptor described by `aio_fildes' member of AIOCBP. */ -extern int aio_fsync (int __operation, struct aiocb *__aiocbp) __THROW; +extern int aio_fsync (int __operation, struct aiocb *__aiocbp) + __THROW __nonnull ((2)); #else # ifdef __REDIRECT_NTH -extern int __REDIRECT_NTH (aio_read, (struct aiocb *__aiocbp), aio_read64); -extern int __REDIRECT_NTH (aio_write, (struct aiocb *__aiocbp), aio_write64); +extern int __REDIRECT_NTH (aio_read, (struct aiocb *__aiocbp), aio_read64) + __nonnull ((1)); +extern int __REDIRECT_NTH (aio_write, (struct aiocb *__aiocbp), aio_write64) + __nonnull ((1)); extern int __REDIRECT_NTH (lio_listio, (int __mode, struct aiocb *__const __list[__restrict_arr], int __nent, struct sigevent *__restrict __sig), - lio_listio64); + lio_listio64) __nonnull ((2)); extern int __REDIRECT_NTH (aio_error, (__const struct aiocb *__aiocbp), - aio_error64); + aio_error64) __nonnull ((1)); extern __ssize_t __REDIRECT_NTH (aio_return, (struct aiocb *__aiocbp), - aio_return64); + aio_return64) __nonnull ((1)); extern int __REDIRECT_NTH (aio_cancel, (int __fildes, struct aiocb *__aiocbp), @@ -194,11 +199,11 @@ extern int __REDIRECT_NTH (aio_cancel, extern int __REDIRECT_NTH (aio_suspend, (__const struct aiocb *__const __list[], int __nent, __const struct timespec *__restrict __timeout), - aio_suspend64); + aio_suspend64) __nonnull ((1)); extern int __REDIRECT_NTH (aio_fsync, (int __operation, struct aiocb *__aiocbp), - aio_fsync64); + aio_fsync64) __nonnull ((2)); # else # define aio_read aio_read64 @@ -213,24 +218,27 @@ extern int __REDIRECT_NTH (aio_fsync, #endif #ifdef __USE_LARGEFILE64 -extern int aio_read64 (struct aiocb64 *__aiocbp) __THROW; -extern int aio_write64 (struct aiocb64 *__aiocbp) __THROW; +extern int aio_read64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1)); +extern int aio_write64 (struct aiocb64 *__aiocbp) __THROW __nonnull ((1)); extern int lio_listio64 (int __mode, struct aiocb64 *__const __list[__restrict_arr], int __nent, struct sigevent *__restrict __sig) - __THROW; + __THROW __nonnull ((2)); -extern int aio_error64 (__const struct aiocb64 *__aiocbp) __THROW; -extern __ssize_t aio_return64 (struct aiocb64 *__aiocbp) __THROW; +extern int aio_error64 (__const struct aiocb64 *__aiocbp) + __THROW __nonnull ((1)); +extern __ssize_t aio_return64 (struct aiocb64 *__aiocbp) + __THROW __nonnull ((1)); extern int aio_cancel64 (int __fildes, struct aiocb64 *__aiocbp) __THROW; extern int aio_suspend64 (__const struct aiocb64 *__const __list[], int __nent, __const struct timespec *__restrict __timeout) - __THROW; + __THROW __nonnull ((1)); -extern int aio_fsync64 (int __operation, struct aiocb64 *__aiocbp) __THROW; +extern int aio_fsync64 (int __operation, struct aiocb64 *__aiocbp) + __THROW __nonnull ((2)); #endif __END_DECLS diff --git a/libc/rt/mqueue.h b/libc/rt/mqueue.h index 1ccad5bba..b81133033 100644 --- a/libc/rt/mqueue.h +++ b/libc/rt/mqueue.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -38,37 +38,40 @@ __BEGIN_DECLS argument is taken as `struct mq_attr *', pointer to message queue attributes. If the fourth argument is NULL, default attributes are used. */ -extern mqd_t mq_open (const char *__name, int __oflag, ...) __THROW; +extern mqd_t mq_open (__const char *__name, int __oflag, ...) + __THROW __nonnull ((1)); /* Removes the association between message queue descriptor MQDES and its message queue. */ extern int mq_close (mqd_t __mqdes) __THROW; /* Query status and attributes of message queue MQDES. */ -extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat) __THROW; +extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat) + __THROW __nonnull ((2)); /* Set attributes associated with message queue MQDES and if OMQSTAT is not NULL also query its old attributes. */ extern int mq_setattr (mqd_t __mqdes, - const struct mq_attr *__restrict __mqstat, - struct mq_attr *__restrict __omqstat) __THROW; + __const struct mq_attr *__restrict __mqstat, + struct mq_attr *__restrict __omqstat) + __THROW __nonnull ((2)); /* Remove message queue named NAME. */ -extern int mq_unlink (const char *__name) __THROW; +extern int mq_unlink (__const char *__name) __THROW __nonnull ((1)); /* Register notification issued upon message arrival to an empty message queue MQDES. */ -extern int mq_notify (mqd_t __mqdes, const struct sigevent *__notification) +extern int mq_notify (mqd_t __mqdes, __const struct sigevent *__notification) __THROW; /* Receive the oldest from highest priority messages in message queue MQDES. */ extern ssize_t mq_receive (mqd_t __mqdes, char *__msg_ptr, size_t __msg_len, - unsigned int *__msg_prio); + unsigned int *__msg_prio) __nonnull ((2)); /* Add message pointed by MSG_PTR to message queue MQDES. */ -extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, - unsigned int __msg_prio); +extern int mq_send (mqd_t __mqdes, __const char *__msg_ptr, size_t __msg_len, + unsigned int __msg_prio) __nonnull ((2)); #ifdef __USE_XOPEN2K /* Receive the oldest from highest priority messages in message queue @@ -76,13 +79,15 @@ extern int mq_send (mqd_t __mqdes, const char *__msg_ptr, size_t __msg_len, extern ssize_t mq_timedreceive (mqd_t __mqdes, char *__restrict __msg_ptr, size_t __msg_len, unsigned int *__restrict __msg_prio, - const struct timespec *__restrict __abs_timeout); + __const struct timespec *__restrict __abs_timeout) + __nonnull ((2, 5)); /* Add message pointed by MSG_PTR to message queue MQDES, stop blocking on full message queue if ABS_TIMEOUT expires. */ -extern int mq_timedsend (mqd_t __mqdes, const char *__msg_ptr, +extern int mq_timedsend (mqd_t __mqdes, __const char *__msg_ptr, size_t __msg_len, unsigned int __msg_prio, - const struct timespec *__abs_timeout); + __const struct timespec *__abs_timeout) + __nonnull ((2, 5)); #endif __END_DECLS diff --git a/libc/rt/tst-mqueue1.c b/libc/rt/tst-mqueue1.c index db4065ea9..9c5d940f9 100644 --- a/libc/rt/tst-mqueue1.c +++ b/libc/rt/tst-mqueue1.c @@ -1,5 +1,5 @@ /* Test message queue passing. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2004. @@ -85,7 +85,7 @@ do_one_test (mqd_t q, const char *name, int nonblock) else result |= check_attrs (&attr, nonblock, 0); - if (mq_receive (q, &v[0], 1, NULL) != -1) + if (mq_receive (q, (char *) &v[0], 1, NULL) != -1) { puts ("mq_receive on O_WRONLY mqd_t unexpectedly succeeded"); result = 1; @@ -109,9 +109,9 @@ do_one_test (mqd_t q, const char *name, int nonblock) for (int i = 0; i < 10; ++i) { if (i & 1) - ret = mq_send (q, &v[i], 1, v[i] >> 4); + ret = mq_send (q, (char *) &v[i], 1, v[i] >> 4); else - ret = mq_timedsend (q, &v[i], 1, v[i] >> 4, &ts); + ret = mq_timedsend (q, (char *) &v[i], 1, v[i] >> 4, &ts); if (ret) { @@ -120,7 +120,7 @@ do_one_test (mqd_t q, const char *name, int nonblock) } } - ret = mq_timedsend (q, &v[10], 1, 8, &ts); + ret = mq_timedsend (q, (char *) &v[10], 1, 8, &ts); if (ret != -1) { puts ("mq_timedsend on full queue did not fail"); @@ -135,7 +135,7 @@ do_one_test (mqd_t q, const char *name, int nonblock) if (nonblock) { - ret = mq_send (q, &v[10], 1, 8); + ret = mq_send (q, (char *) &v[10], 1, 8); if (ret != -1) { puts ("mq_send on full non-blocking queue did not fail"); @@ -194,7 +194,7 @@ do_one_test (mqd_t q, const char *name, int nonblock) unsigned int prio; ssize_t rets; - if (mq_send (q, &v[0], 1, 1) != -1) + if (mq_send (q, (char *) &v[0], 1, 1) != -1) { puts ("mq_send on O_RDONLY mqd_t unexpectedly succeeded"); result = 1; @@ -208,9 +208,9 @@ do_one_test (mqd_t q, const char *name, int nonblock) for (int i = 0; i < 10; ++i) { if (i & 1) - rets = mq_receive (q, &vr[i], 1, &prio); + rets = mq_receive (q, (char *) &vr[i], 1, &prio); else - rets = mq_timedreceive (q, &vr[i], 1, &prio, &ts); + rets = mq_timedreceive (q, (char *) &vr[i], 1, &prio, &ts); if (rets != 1) { @@ -236,7 +236,7 @@ do_one_test (mqd_t q, const char *name, int nonblock) result = 1; } - rets = mq_timedreceive (q, &vr[10], 1, &prio, &ts); + rets = mq_timedreceive (q, (char *) &vr[10], 1, &prio, &ts); if (rets != -1) { puts ("mq_timedreceive on empty queue did not fail"); @@ -251,7 +251,7 @@ do_one_test (mqd_t q, const char *name, int nonblock) if (nonblock) { - ret = mq_receive (q, &vr[10], 1, &prio); + ret = mq_receive (q, (char *) &vr[10], 1, &prio); if (ret != -1) { puts ("mq_receive on empty non-blocking queue did not fail"); |