linux_socket.c (6cec9cad762b6476313fb1f8e931a1647822db6b) | linux_socket.c (6e646651d358c6de266562e0dc5c621b7ea4cd8d) |
---|---|
1/*- 2 * Copyright (c) 1995 Søren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 717 unchanged lines hidden (view full) --- 726 struct sockaddr *sa; 727 int error; 728 729 error = linux_getsockaddr(&sa, PTRIN(args->name), 730 args->namelen); 731 if (error) 732 return (error); 733 | 1/*- 2 * Copyright (c) 1995 Søren Schmidt 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 717 unchanged lines hidden (view full) --- 726 struct sockaddr *sa; 727 int error; 728 729 error = linux_getsockaddr(&sa, PTRIN(args->name), 730 args->namelen); 731 if (error) 732 return (error); 733 |
734 error = kern_bind(td, args->s, sa); | 734 error = kern_bindat(td, AT_FDCWD, args->s, sa); |
735 free(sa, M_SONAME); 736 if (error == EADDRNOTAVAIL && args->namelen != sizeof(struct sockaddr_in)) 737 return (EINVAL); 738 return (error); 739} 740 741struct linux_connect_args { 742 int s; --- 11 unchanged lines hidden (view full) --- 754 u_int fflag; 755 int error; 756 757 error = linux_getsockaddr(&sa, (struct osockaddr *)PTRIN(args->name), 758 args->namelen); 759 if (error) 760 return (error); 761 | 735 free(sa, M_SONAME); 736 if (error == EADDRNOTAVAIL && args->namelen != sizeof(struct sockaddr_in)) 737 return (EINVAL); 738 return (error); 739} 740 741struct linux_connect_args { 742 int s; --- 11 unchanged lines hidden (view full) --- 754 u_int fflag; 755 int error; 756 757 error = linux_getsockaddr(&sa, (struct osockaddr *)PTRIN(args->name), 758 args->namelen); 759 if (error) 760 return (error); 761 |
762 error = kern_connect(td, args->s, sa); | 762 error = kern_connectat(td, AT_FDCWD, args->s, sa); |
763 free(sa, M_SONAME); 764 if (error != EISCONN) 765 return (error); 766 767 /* 768 * Linux doesn't return EISCONN the first time it occurs, 769 * when on a non-blocking socket. Instead it returns the 770 * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD. --- 941 unchanged lines hidden --- | 763 free(sa, M_SONAME); 764 if (error != EISCONN) 765 return (error); 766 767 /* 768 * Linux doesn't return EISCONN the first time it occurs, 769 * when on a non-blocking socket. Instead it returns the 770 * error getsockopt(SOL_SOCKET, SO_ERROR) would return on BSD. --- 941 unchanged lines hidden --- |