Ignore:
Timestamp:
08/20/98 22:04:22 (24 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
a9cfa238
Parents:
96b39164
Message:

Patches from Eric Norum

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libnetworking/rtems/rtems_syscall.c

    r96b39164 r28e7d7fa  
    618618}
    619619
    620 int
    621 getpeername (int s, struct sockaddr *name, int *namelen)
     620static int
     621getpeersockname (int s, struct sockaddr *name, int *namelen, int pflag)
    622622{
    623623        struct socket *so;
     
    637637                return -1;
    638638        }
    639         error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
     639        if (pflag)
     640                error = (*so->so_proto->pr_usrreqs->pru_peeraddr)(so, m);
     641        else
     642                error = (*so->so_proto->pr_usrreqs->pru_sockaddr)(so, m);
    640643        if (error) {
    641644                errno = error;
     
    651654        rtems_bsdnet_semaphore_release ();
    652655        return 0;
     656}
     657
     658int
     659getpeername (int s, struct sockaddr *name, int *namelen)
     660{
     661        return getpeersockname (s, name, namelen, 1);
     662}
     663int
     664getsockname (int s, struct sockaddr *name, int *namelen)
     665{
     666        return getpeersockname (s, name, namelen, 0);
    653667}
    654668
Note: See TracChangeset for help on using the changeset viewer.