Commit Graph

16 Commits

Author SHA1 Message Date
chao.an c65d8e6a23 net/socket: add MSG_DONTWAIT support
MSG_DONTWAIT (since Linux 2.2)
  Enables nonblocking operation; if the operation would block, the
  call fails with the error EAGAIN or EWOULDBLOCK. This provides
  similar behavior to setting the O_NONBLOCK flag (via the fcntl(2)
  F_SETFL operation), but differs in that MSG_DONTWAIT is a per-call
  option, whereas O_NONBLOCK is a setting on the open file description
  (see open(2)), which will affect all threads in the calling process
  and as well as other processes that hold file descriptors referring
  to the same open file description.
2020-02-19 12:21:28 -06:00
Xiang Xiao 6a3c2aded6 Fix wait loop and void cast (#24)
* Simplify EINTR/ECANCEL error handling

1. Add semaphore uninterruptible wait function
2 .Replace semaphore wait loop with a single uninterruptible wait
3. Replace all sem_xxx to nxsem_xxx

* Unify the void cast usage

1. Remove void cast for function because many place ignore the returned value witout cast
2. Replace void cast for variable with UNUSED macro
2020-01-02 10:54:43 -06:00
Gregory Nutt 3b275fcf4e net/: Run nxstyle against all C files. 2019-10-25 11:31:42 -06:00
Gregory Nutt 1346f29151 net/: Fix alignment and spacing problems found by tools/nxstyle. 2019-07-02 18:02:23 -06:00
Gregory Nutt 3a4984a40b Rename file_close_detached() to juse file_close() for better consistency in naming. 2018-09-15 13:04:56 -06:00
Gregory Nutt 21041af8a7 This commit modifies the Unix domain local socket design. Local sockets are built on top of pipes. The Local socket implementation maintained file descriptors to interrupt with the pipes. File descriptors have the bad property that they are valid only while running on the thread within the task that created the local socket.
As a policy, all internal OS implementations must use "detached" files which are valid in any context and do not depend on the validity of a file descriptor at any point in time.  This commit converts the usage of file descriptors to detached files throughout the local socket implementation.

Squashed commit of the following:

    net/local: Finish change to eliminate use of file descriptors.
    net/local:  A little more of the conversion.
    net/local: Beginning of chnages to eliminate use of file descriptors in the local socket implementeation. poll() will be a problem.
2017-11-02 08:23:38 -06:00
Gregory Nutt d5207efb5a Be consistent... Use Name: consistent in function headers vs Function: 2017-04-21 16:33:14 -06:00
Gregory Nutt a1469a3e95 Add CONFIG_DEBUG_ERROR. Change names of *dbg() * *err() 2016-06-11 15:50:49 -06:00
Gregory Nutt 6209c51206 net/: More clean-up of spacing/alignment issues 2015-10-08 15:10:04 -06:00
Gregory Nutt 0fc8d2fcc5 Unix domain: Add options to build in stream or datagram support separately 2015-01-31 07:58:51 -06:00
Gregory Nutt 62b706fa68 If a Unix domain socket is non-blocking, then the underlying FIFO should also be opened non-blocking 2015-01-30 12:43:37 -06:00
Gregory Nutt 2a39105b3f Unix domain: Add logic to release references to the half duplex FIFO after sendto and recvfrom 2015-01-30 09:28:55 -06:00
Gregory Nutt 0deca5b039 Unix domain: Various fixes to get apps/examplex/udgram working 2015-01-29 11:05:04 -06:00
Gregory Nutt e5f820a2cd Unix domain: Add sendto logic for SOCK_DRAM protocoal 2015-01-29 10:40:10 -06:00
Gregory Nutt 2c7123197c Networking: Move UDP-specifc parts of sendto() out of socket/sendto.c and into udp/udp_sendto.c. Hook in Unix domain sokcet sendto() logic (still just a stub for the moment) 2015-01-28 13:41:24 -06:00
Gregory Nutt 2201c9b449 Add stub files for sending and receiving on FIFOs 2015-01-26 17:28:36 -06:00