diff options
author | Mike Pape <dotzenlabs@gmail.com> | 2010-11-04 02:35:09 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-04 16:53:49 -0700 |
commit | 772991af40e139814368762d4075be324bfdab77 (patch) | |
tree | 19de3baa67240b23ef4feef6f01d59425c3fc643 /compat/mingw.h | |
parent | ca209065f3cc3462eb0ae6090f6b13f38aa2114c (diff) | |
download | git-772991af40e139814368762d4075be324bfdab77.tar.gz |
mingw: add network-wrappers for daemon
git-daemon requires some socket-functionality that is not yet
supported in the Windows-port. This patch adds said functionality,
and makes sure WSAStartup gets called by socket(), since it is the
first network-call in git-daemon.
Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.h')
-rw-r--r-- | compat/mingw.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h index 83e35e833b..a5bde82b9a 100644 --- a/compat/mingw.h +++ b/compat/mingw.h @@ -7,6 +7,7 @@ typedef int pid_t; typedef int uid_t; +typedef int socklen_t; #define hstrerror strerror #define S_IFLNK 0120000 /* Symbolic link */ @@ -47,6 +48,9 @@ typedef int uid_t; #define F_SETFD 2 #define FD_CLOEXEC 0x1 +#define EAFNOSUPPORT WSAEAFNOSUPPORT +#define ECONNABORTED WSAECONNABORTED + struct passwd { char *pw_name; char *pw_gecos; @@ -225,6 +229,18 @@ int mingw_socket(int domain, int type, int protocol); int mingw_connect(int sockfd, struct sockaddr *sa, size_t sz); #define connect mingw_connect +int mingw_bind(int sockfd, struct sockaddr *sa, size_t sz); +#define bind mingw_bind + +int mingw_setsockopt(int sockfd, int lvl, int optname, void *optval, int optlen); +#define setsockopt mingw_setsockopt + +int mingw_listen(int sockfd, int backlog); +#define listen mingw_listen + +int mingw_accept(int sockfd, struct sockaddr *sa, socklen_t *sz); +#define accept mingw_accept + int mingw_rename(const char*, const char*); #define rename mingw_rename |