source: vendor/emx/current/src/libsocket/accept.c

Last change on this file was 18, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 467 bytes
Line 
1/* accept.c (emx+gcc) -- Copyright (c) 1994-1996 by Eberhard Mattes */
2
3#include <sys/fcntl.h>
4#include <errno.h>
5#include <emx/io.h>
6#include <emx/syscalls.h>
7
8int accept (int handle, struct sockaddr *addr, int *paddrlen)
9{
10 int s, *pflags;
11
12 s = __accept (handle, addr, paddrlen);
13 if (s < 0)
14 return -1;
15 if ((pflags = _fd_init (s)) == NULL)
16 {
17 __close (s);
18 errno = EMFILE;
19 return -1;
20 }
21 *pflags = O_RDWR | F_SOCKET;
22 return s;
23}
Note: See TracBrowser for help on using the repository browser.