diff options
author | Ron Yorston <rmy@pobox.com> | 2020-04-05 09:49:57 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-04-05 10:04:56 +0100 |
commit | 2b4c25bd2cac034cdc52d29d6bb8c675c87a731c (patch) | |
tree | 5f542026304bb44ce738226acecfb9a9a0c84e8f /win32/net.c | |
parent | 1365eb25a7dfd3e42229691355d910ff32b92361 (diff) | |
download | busybox-w32-2b4c25bd2cac034cdc52d29d6bb8c675c87a731c.tar.gz busybox-w32-2b4c25bd2cac034cdc52d29d6bb8c675c87a731c.tar.bz2 busybox-w32-2b4c25bd2cac034cdc52d29d6bb8c675c87a731c.zip |
win32: new functions: getpeername(2), mingw_spawn_detach()
Implement getpeername(2).
Add mingw_spawn_detach() to allow the spawned process to detach from
the console.
Diffstat (limited to 'win32/net.c')
-rw-r--r-- | win32/net.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/win32/net.c b/win32/net.c index 2341119b0..01fa16a4e 100644 --- a/win32/net.c +++ b/win32/net.c | |||
@@ -99,3 +99,15 @@ int mingw_accept(int sockfd1, struct sockaddr *sa, socklen_t *sz) | |||
99 | } | 99 | } |
100 | return sockfd2; | 100 | return sockfd2; |
101 | } | 101 | } |
102 | |||
103 | #undef getpeername | ||
104 | int mingw_getpeername(int fd, struct sockaddr *sa, socklen_t *sz) | ||
105 | { | ||
106 | SOCKET sock = (SOCKET)_get_osfhandle(fd); | ||
107 | |||
108 | if (sock == INVALID_SOCKET) { | ||
109 | errno = EBADF; | ||
110 | return -1; | ||
111 | } | ||
112 | return getpeername(sock, sa, sz); | ||
113 | } | ||