On success, sched_getscheduler() returns the policy for
the task (either SCHED_FIFO or SCHED_RR).
- On error, ERROR (-1) is returned, and errno is set appropriately:
+ On error, ERROR (-1) is returned, anderrno
is set appropriately:
- ESRCH The task whose ID is pid could not be found.
@@ -893,7 +894,7 @@ priority of the calling task is returned.
Returned Values:
On success, sched_rr_get_interval() returns OK (0). On
- error, ERROR (-1) is returned, and errno is set to:
+ error, ERROR (-1) is returned, anderrno
is set to:
+ #include
+ ssize_t recvfrom(int sockfd, void *buf, size_t len, int flags,
+ struct sockaddr *from, socklen_t *fromlen);
+
+
+ Description:
+ recvfrom()
receives messages from a socket, and may be used to receive
+ data on a socket whether or not it is connection-oriented.
+
+
+ If from
is not NULL, and the underlying protocol provides the source
+ address, this source address is filled in. The argument fromlen
+ initialized to the size of the buffer associated with from
, and modified
+ on return to indicate the actual size of the address stored there.
+
+
+ Input Parameters:
+
+
+ sockfd
: Socket descriptor of socket.
+ buf
: Buffer to receive data.
+ len
: Length of buffer.
+ flags
: Receive flags.
+ from
: Address of source.
+ fromlen
: The length of the address structure.
+
+
+ Returned Values:
+ On success, returns the number of characters sent.
+ On error, -1 is returned, and errno is set appropriately:
+
+
+ EAGAIN
.
+ The socket is marked non-blocking and the receive operation would block,
+ or a receive timeout had been set and the timeout expired before data
+ was received.
+ EBADF
.
+ The argument sockfd
is an invalid descriptor.
+ ECONNREFUSED
.
+ A remote host refused to allow the network connection (typically because
+ it is not running the requested service).
+ EFAULT
.
+ The receive buffer pointer(s) point outside the process's address space.
+ EINTR
.
+ The receive was interrupted by delivery of a signal before any data were
+ available.
+ EINVAL
.
+ Invalid argument passed.
+ ENOMEM
.
+ Could not allocate memory.
+ ENOTCONN
.
+ The socket is associated with a connection-oriented protocol and has
+ not been connected.
+ ENOTSOCK
.
+ The argument sockfd
does not refer to a socket.
+
+
+
+
+ Function Prototype:
+
+
+ #include
+ int setsockopt(int sockfd, int level, int option,
+ const void *value, socklen_t value_len);
+
+
+ Description:
+ setsockopt()
sets the option specified by the option
argument,
+ at the protocol level specified by the level
argument, to the value
+ pointed to by the value
argument for the socket associated with the
+ file descriptor specified by the sockfd
argument.
+
+
+ The level
argument specifies the protocol level of the option. To set
+ options at the socket level, specify the level argument as SOL_SOCKET.
+
+
+ See a complete list of values for the option
argument.
+
+
+ Input Parameters:
+
+
+ sockfd
: Socket descriptor of socket
+ level
: Protocol level to set the option
+ option
: identifies the option to set
+ value
: Points to the argument value
+ value_len
: The length of the argument value
+
+
+ Returned Values:
+ On success, returns the number of characters sent.
+ On error, -1 is returned, and errno is set appropriately:
+
+
+ BADF
.
+ The sockfd
argument is not a valid socket descriptor.
+ DOM
.
+ The send and receive timeout values are too big to fit into the
+ timeout fields in the socket structure.
+ INVAL
.
+ The specified option is invalid at the specified socket level
or the
+ socket has been shut down.
+ ISCONN
.
+ The socket is already connected, and a specified option cannot be set
+ while the socket is connected.
+ NOPROTOOPT
.
+ The option
is not supported by the protocol.
+ NOTSOCK
.
+ The sockfd
argument does not refer to a socket.
+ NOMEM
.
+ There was insufficient memory available for the operation to complete.
+ NOBUFS
.
+ Insufficient resources are available in the system to complete the call.
+
+
+
+
+ Function Prototype:
+
+
+ #include
+ int getsockopt(int sockfd, int level, int option,
+ void *value, socklen_t *value_len);
+
+
+ Description:
+ getsockopt()
retrieve thse value for the option specified by the
+ option
argument for the socket specified by the sockfd
argument. If
+ the size of the option value is greater than value_len
, the value
+ stored in the object pointed to by the value
argument will be silently
+ truncated. Otherwise, the length pointed to by the value_len
argument
+ will be modified to indicate the actual length of thevalue
.
+
+
+ The level
argument specifies the protocol level of the option. To
+ retrieve options at the socket level, specify the level argument as
+ SOL_SOCKET.
+
+
+ See a complete list of values for the option
argument.
+
+
+ Input Parameters:
+
+
+ sockfd Socket descriptor of socket
+ level Protocol level to set the option
+ option identifies the option to get
+ value Points to the argument value
+ value_len The length of the argument value
+
+
+ Returned Values:
+ On success, returns the number of characters sent.
+ On error, -1 is returned, and errno is set appropriately:
+
+
+ BADF
.
+ The sockfd
argument is not a valid socket descriptor.
+ INVAL
.
+ The specified option is invalid at the specified socket level
or the
+ socket has been shutdown.
+ NOPROTOOPT
.
+ The option
is not supported by the protocol.
+ NOTSOCK
.
+ The sockfd
argument does not refer to a socket.
+ NOBUFS
+ Insufficient resources are available in the system to complete the call.
+
+
3.1 Scalar types
@@ -5815,8 +6311,8 @@ function call:
Description: osGetErrnorPtr() returns a pointer to
the thread-specific errno value.
-This differs somewhat from the use for errno in a multi-threaded process environment:
-Each pthread will have its own private copy of errno and the errno will not be shared
+This differs somewhat from the use forerrno
in a multi-threaded process environment:
+Each pthread will have its own private copy oferrno
and theerrno
will not be shared
between pthreads.
Input Parameters: None
@@ -5970,17 +6466,22 @@ notify a task when a message is available on a queue.
-
+
+
+
+ - bind
- clock_getres
- clock_gettime
- Clocks
- clock_settime
+ - connect
- Data structures
- Directory operations
- Driver operations
- exit
- Filesystem interfaces
- getpid
+ - getsockopt
- gmtime_r
- Introduction
- kill
@@ -5997,6 +6498,7 @@ notify a task when a message is available on a queue.
- mq_timedreceive
- mq_timedsend
- mq_unlink
+ - Network Interfaces
- OS Interfaces
- Pthread Interfaces
- pthread_attr_destroy
@@ -6040,6 +6542,8 @@ notify a task when a message is available on a queue.
- pthread_mutexattr_setpshared
- pthread_mutex_destroy
- pthread_mutex_init
+ |
+
- pthread_mutex_lock
- pthread_mutex_trylock
- pthread_mutex_unlock
@@ -6052,6 +6556,8 @@ notify a task when a message is available on a queue.
- pthread_sigmask
- pthread_testcancelstate
- pthread_yield
+ - recv
+ - recvfrom
- sched_getparam
- sched_get_priority_max
- sched_get_priority_min
@@ -6073,6 +6579,9 @@ notify a task when a message is available on a queue.
- sem_unlink
- sem_wait
- sched_getscheduler
+ - send
+ - sendto
+ - setsockopt
- sigaction
- sigaddset
- sigdelset
@@ -6086,6 +6595,7 @@ notify a task when a message is available on a queue.
- sigsuspend
- sigtimedwait
- sigwaitinfo
+ - socket
- Standard I/O
- task_activate
- Task Control Interfaces
@@ -6107,7 +6617,9 @@ notify a task when a message is available on a queue.
- wd_delete
- wd_gettime
- wd_start
-
+ |
+
+