Changeset 1641088 in rtems


Ignore:
Timestamp:
Apr 22, 2016, 7:14:34 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
e800b07
Parents:
c6cb9ba
git-author:
Sebastian Huber <sebastian.huber@…> (04/22/16 07:14:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/22/16 07:25:11)
Message:

network: Ensure matching syscall prototypes

Ensure that kernel and user space system call protoypes are identical.

Location:
cpukit/libnetworking
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libnetworking/Makefile.am

    rc6cb9ba r1641088  
    256256lib_a_SOURCES = lib/getprotoby.c lib/rtems_bsdnet_ntp.c lib/ftpfs.c \
    257257    lib/syslog.c lib/tftpDriver.c
     258lib_a_SOURCES += rtems/rtems_syscall_api.c
    258259endif
    259260
  • cpukit/libnetworking/kern/kern_sysctl.c

    rc6cb9ba r1641088  
    9595#endif
    9696
    97 static int sysctl_root(SYSCTL_HANDLER_ARGS);
     97static int sysctl_root(struct sysctl_oid *oidp, const void *arg1,
     98    intptr_t arg2, struct sysctl_req *req);
    9899
    99100struct sysctl_oid_list sysctl__children; /* root list */
     
    10951096
    10961097int
    1097 sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
     1098sysctl_find_oid(const int *name, u_int namelen, struct sysctl_oid **noid,
    10981099    int *nindx, struct sysctl_req *req)
    10991100{
     
    11391140
    11401141static int
    1141 sysctl_root(SYSCTL_HANDLER_ARGS)
     1142sysctl_root(struct sysctl_oid *oidp, const void *arg1, intptr_t arg2,
     1143    struct sysctl_req *req)
    11421144{
    11431145        struct sysctl_oid *oid;
     
    11981200}
    11991201
     1202#ifndef __rtems__
    12001203#ifndef _SYS_SYSPROTO_H_
    12011204struct sysctl_args {
     
    12411244        return (error);
    12421245}
     1246#endif /* __rtems__ */
    12431247
    12441248/*
     
    12471251 */
    12481252int
    1249 userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
    1250     size_t *oldlenp, int inkernel, void *new, size_t newlen, size_t *retval)
     1253userland_sysctl(struct thread *td, const int *name, u_int namelen, void *old,
     1254    size_t *oldlenp, int inkernel, const void *new, size_t newlen, size_t *retval)
    12511255{
    12521256        int error = 0;
  • cpukit/libnetworking/rtems/rtems_syscall.c

    rc6cb9ba r1641088  
    2929#include <net/route.h>
    3030
    31 /*
    32  *  Since we are "in the kernel", these do not get prototyped in sys/socket.h
    33  */
    34 ssize_t send(int, const void *, size_t, int);
    35 ssize_t recv(int, void *, size_t, int);
     31#include "rtems_syscall.h"
    3632
    3733/*
     
    146142
    147143int
    148 bind (int s, struct sockaddr *name, int namelen)
     144bind (int s, const struct sockaddr *name, socklen_t namelen)
    149145{
    150146        int error;
     
    173169
    174170int
    175 connect (int s, struct sockaddr *name, int namelen)
     171connect (int s, const struct sockaddr *name, socklen_t namelen)
    176172{
    177173        int error;
     
    245241
    246242int
    247 accept (int s, struct sockaddr *name, int *namelen)
     243accept (int s, struct sockaddr *name, socklen_t *namelen)
    248244{
    249245        int fd;
     
    413409 */
    414410ssize_t
    415 sendto (int s, const void *buf, size_t buflen, int flags, const struct sockaddr *to, int tolen)
     411sendto (int s, const void *buf, size_t buflen, int flags, const struct sockaddr *to, socklen_t tolen)
    416412{
    417413        struct msghdr msg;
     
    527523 */
    528524ssize_t
    529 recvfrom (int s, void *buf, size_t buflen, int flags, const struct sockaddr *from, int *fromlen)
     525recvfrom (int s, void *buf, size_t buflen, int flags, struct sockaddr *from, socklen_t *fromlen)
    530526{
    531527        struct msghdr msg;
     
    551547
    552548int
    553 setsockopt (int s, int level, int name, const void *val, int len)
     549setsockopt (int s, int level, int name, const void *val, socklen_t len)
    554550{
    555551        struct socket *so;
     
    586582
    587583int
    588 getsockopt (int s, int level, int name, void *aval, int *avalsize)
     584getsockopt (int s, int level, int name, void *aval, socklen_t *avalsize)
    589585{
    590586        struct socket *so;
     
    629625
    630626static int
    631 getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
     627getpeersockname (int s, struct sockaddr *name, socklen_t *namelen, int pflag)
    632628{
    633629        struct socket *so;
     
    668664
    669665int
    670 getpeername (int s, struct sockaddr *name, int *namelen)
     666getpeername (int s, struct sockaddr *name, socklen_t *namelen)
    671667{
    672668        return getpeersockname (s, name, namelen, 1);
    673669}
    674670int
    675 getsockname (int s, struct sockaddr *name, int *namelen)
     671getsockname (int s, struct sockaddr *name, socklen_t *namelen)
    676672{
    677673        return getpeersockname (s, name, namelen, 0);
     
    679675
    680676int
    681 sysctl(int *name, u_int namelen, void *oldp,
    682        size_t *oldlenp, void *newp, size_t newlen)
     677sysctl(const int *name, u_int namelen, void *oldp,
     678       size_t *oldlenp, const void *newp, size_t newlen)
    683679{
    684680  int    error;
  • cpukit/libnetworking/sys/sysctl.h

    rc6cb9ba r1641088  
    133133        size_t          oldidx;
    134134        int             (*oldfunc)(struct sysctl_req *, const void *, size_t);
    135         void            *newptr;
     135        const void              *newptr;
    136136        size_t          newlen;
    137137        size_t          newidx;
     
    623623                void *old, size_t *oldlenp, void *new, size_t newlen,
    624624                size_t *retval);
    625 int     userland_sysctl(struct thread *td, int *name, u_int namelen, void *old,
    626                         size_t *oldlenp, int inkernel, void *new, size_t newlen,
     625int     userland_sysctl(struct thread *td, const int *name, u_int namelen, void *old,
     626                        size_t *oldlenp, int inkernel, const void *new, size_t newlen,
    627627                        size_t *retval);
    628 int     sysctl_find_oid(int *name, u_int namelen, struct sysctl_oid **noid,
     628int     sysctl_find_oid(const int *name, u_int namelen, struct sysctl_oid **noid,
    629629                        int *nindx, struct sysctl_req *req);
    630630int     sysctl_wire_old_buffer(struct sysctl_req *req, size_t len);
Note: See TracChangeset for help on using the changeset viewer.