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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
//==========================================================================
2
//
3
//      lib/recvfrom.c
4
//
5
//      recvfrom() 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
ssize_t
38
recvfrom(int s, const void *buf, size_t buflen,
39
       int flags, const struct sockaddr *from, socklen_t *fromlen)
40
{
41
    struct sys_recvfrom_args args;
42
    int res, error;
43
    SYSCALLARG(args,s) = s;
44
    SYSCALLARG(args,buf) = (void *)buf;
45
    SYSCALLARG(args,len) = buflen;
46
    SYSCALLARG(args,flags) = flags;
47
    SYSCALLARG(args,from) = (struct sockaddr *)from;
48
    SYSCALLARG(args,fromlenaddr) = fromlen;
49
    error = sys_recvfrom(&args, &res);
50
    if (error) {
51
        errno = error;
52
        return -1;
53
    } else {
54
        return res;
55
    }
56
}

powered by: WebSVN 2.1.0

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