OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [net/] [tcpip/] [current/] [src/] [lib/] [accept.c] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      lib/accept.c
4
//
5
//      accept() system call
6
//
7
//==========================================================================
8
// ####BSDALTCOPYRIGHTBEGIN####                                             
9
// -------------------------------------------                              
10
// Portions of this software may have been derived from OpenBSD             
11
// or other sources, and if so are covered by the appropriate copyright     
12
// and license included herein.                                             
13
// -------------------------------------------                              
14
// ####BSDALTCOPYRIGHTEND####                                               
15
//==========================================================================
16
//#####DESCRIPTIONBEGIN####
17
//
18
// Author(s):    gthomas
19
// Contributors: gthomas
20
// Date:         2000-01-10
21
// Purpose:      
22
// Description:  
23
//              
24
//
25
//####DESCRIPTIONEND####
26
//
27
//==========================================================================
28
 
29
 
30
#include <sys/param.h>
31
#include <cyg/io/file.h>
32
#include <sys/socket.h>
33
#include <sys/socketvar.h>
34
 
35
#include <sys/syscallargs.h>
36
 
37
int
38
accept(int s, const struct sockaddr *name, socklen_t *anamelen)
39
{
40
    struct sys_accept_args args;
41
    int res, error;
42
    SYSCALLARG(args,s) = s;
43
    SYSCALLARG(args,name) = (struct sockaddr *)name;
44
    SYSCALLARG(args,anamelen) = anamelen;
45
    error = sys_accept(&args, &res);
46
    if (error) {
47
        errno = error;
48
        return -1;
49
    } else {
50
        return res;
51
    }
52
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.