summaryrefslogtreecommitdiff
path: root/nt/inc/sys
diff options
context:
space:
mode:
Diffstat (limited to 'nt/inc/sys')
-rw-r--r--nt/inc/sys/resource.h51
-rw-r--r--nt/inc/sys/socket.h11
-rw-r--r--nt/inc/sys/stat.h14
-rw-r--r--nt/inc/sys/wait.h6
4 files changed, 73 insertions, 9 deletions
diff --git a/nt/inc/sys/resource.h b/nt/inc/sys/resource.h
new file mode 100644
index 00000000000..dfa0318cb40
--- /dev/null
+++ b/nt/inc/sys/resource.h
@@ -0,0 +1,51 @@
+/* A limited emulation of sys/resource.h.
+
+Copyright (C) 2016 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef INC_SYS_RESOURCE_H_
+#define INC_SYS_RESOURCE_H_
+
+/* We only support RLIMIT_STACK and RLIMIT_NOFILE for now. */
+enum rlimit_resource {
+ RLIMIT_STACK = 0,
+#define RLIMIT_STACK RLIMIT_STACK
+
+ RLIMIT_NOFILE = 1,
+#define RLIMIT_NOFILE RLIMIT_NOFILE
+
+ RLIMIT_NLIMITS
+#define RLIMIT_NLIMITS RLIMIT_NLIMITS
+};
+
+typedef enum rlimit_resource rlimit_resource_t;
+
+/* We use a 64-bit data type because some values could potentially be
+ 64-bit wide even in 32-bit builds. */
+typedef long long rlim_t;
+
+#define RLIMIT_INFINITY ((rlim_t) -1)
+
+struct rlimit {
+ rlim_t rlim_cur; /* current soft limit */
+ rlim_t rlim_max; /* hard limit */
+};
+
+extern int getrlimit (rlimit_resource_t, struct rlimit *);
+extern int setrlimit (rlimit_resource_t, const struct rlimit *);
+
+#endif /* INC_SYS_RESOURCE_H_ */
diff --git a/nt/inc/sys/socket.h b/nt/inc/sys/socket.h
index 067effe929e..e9a021a5038 100644
--- a/nt/inc/sys/socket.h
+++ b/nt/inc/sys/socket.h
@@ -1,11 +1,11 @@
-/* Copyright (C) 1995, 2001-2015 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 2001-2016 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -99,6 +99,8 @@ typedef unsigned short uint16_t;
#define accept sys_accept
#define recvfrom sys_recvfrom
#define sendto sys_sendto
+#define getaddrinfo sys_getaddrinfo
+#define freeaddrinfo sys_freeaddrinfo
int sys_socket(int af, int type, int protocol);
int sys_bind (int s, const struct sockaddr *addr, int namelen);
@@ -119,6 +121,9 @@ int sys_recvfrom (int s, char *buf, int len, int flags,
struct sockaddr *from, int * fromlen);
int sys_sendto (int s, const char * buf, int len, int flags,
const struct sockaddr *to, int tolen);
+int sys_getaddrinfo (const char * node, const char * service,
+ const struct addrinfo * hints, struct addrinfo ** res);
+void sys_freeaddrinfo (struct addrinfo * ai);
/* In addition to wrappers for the winsock functions, we also provide
an fcntl function, for setting sockets to non-blocking mode. */
diff --git a/nt/inc/sys/stat.h b/nt/inc/sys/stat.h
index 9b493539450..ea14f075471 100644
--- a/nt/inc/sys/stat.h
+++ b/nt/inc/sys/stat.h
@@ -1,14 +1,14 @@
/* sys/stat.h supplied with MSVCRT uses too narrow data types for
inode and user/group id, so we replace them with our own.
-Copyright (C) 2008-2015 Free Software Foundation, Inc.
+Copyright (C) 2008-2016 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -30,6 +30,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
# define __MINGW_NOTHROW
#endif
+/* Prevent the MinGW stat.h header from being included, ever. */
+#ifndef _SYS_STAT_H
+# define _SYS_STAT_H
+#endif
+#ifndef _INC_STAT_H
+# define _INC_STAT_H
+#endif
+
#include <sys/types.h>
#include <time.h>
diff --git a/nt/inc/sys/wait.h b/nt/inc/sys/wait.h
index 8f9628f1553..46dae494997 100644
--- a/nt/inc/sys/wait.h
+++ b/nt/inc/sys/wait.h
@@ -1,13 +1,13 @@
/* A limited emulation of sys/wait.h on Posix systems.
-Copyright (C) 2012-2015 Free Software Foundation, Inc.
+Copyright (C) 2012-2016 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of