Skip to content

Commit ea13740

Browse files
authored
bpo-34674: Assume unistd.h exists on Unix. (GH-9290)
1 parent 1aeba74 commit ea13740

File tree

5 files changed

+3
-41
lines changed

5 files changed

+3
-41
lines changed

Include/Python.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include <errno.h>
3333
#endif
3434
#include <stdlib.h>
35-
#ifdef HAVE_UNISTD_H
35+
#ifndef MS_WINDOWS
3636
#include <unistd.h>
3737
#endif
3838
#ifdef HAVE_CRYPT_H

Modules/posixmodule.c

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -213,41 +213,6 @@ module os
213213
extern char *ctermid_r(char *);
214214
#endif
215215

216-
#ifndef HAVE_UNISTD_H
217-
#if ( defined(__WATCOMC__) || defined(_MSC_VER) ) && !defined(__QNX__)
218-
extern int mkdir(const char *);
219-
#else
220-
extern int mkdir(const char *, mode_t);
221-
#endif
222-
#if defined(__IBMC__) || defined(__IBMCPP__)
223-
extern int chdir(char *);
224-
extern int rmdir(char *);
225-
#else
226-
extern int chdir(const char *);
227-
extern int rmdir(const char *);
228-
#endif
229-
extern int chmod(const char *, mode_t);
230-
/*#ifdef HAVE_FCHMOD
231-
extern int fchmod(int, mode_t);
232-
#endif*/
233-
/*#ifdef HAVE_LCHMOD
234-
extern int lchmod(const char *, mode_t);
235-
#endif*/
236-
extern int chown(const char *, uid_t, gid_t);
237-
extern char *getcwd(char *, int);
238-
extern char *strerror(int);
239-
extern int link(const char *, const char *);
240-
extern int rename(const char *, const char *);
241-
extern int stat(const char *, struct stat *);
242-
extern int unlink(const char *);
243-
#ifdef HAVE_SYMLINK
244-
extern int symlink(const char *, const char *);
245-
#endif /* HAVE_SYMLINK */
246-
#ifdef HAVE_LSTAT
247-
extern int lstat(const char *, struct stat *);
248-
#endif /* HAVE_LSTAT */
249-
#endif /* !HAVE_UNISTD_H */
250-
251216
#endif /* !_MSC_VER */
252217

253218
#ifdef HAVE_POSIX_SPAWN

Modules/resource.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
#include <sys/time.h>
55
#include <string.h>
66
#include <errno.h>
7-
/* for sysconf */
8-
#if defined(HAVE_UNISTD_H)
97
#include <unistd.h>
10-
#endif
118

129
/* On some systems, these aren't in any header file.
1310
On others they are, with inconsistent prototypes.

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7725,7 +7725,7 @@ for ac_header in asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
77257725
fcntl.h grp.h \
77267726
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
77277727
sched.h shadow.h signal.h stropts.h termios.h \
7728-
unistd.h utime.h \
7728+
utime.h \
77297729
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
77307730
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
77317731
sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2066,7 +2066,7 @@ AC_CHECK_HEADERS(asm/types.h crypt.h conio.h direct.h dlfcn.h errno.h \
20662066
fcntl.h grp.h \
20672067
ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \
20682068
sched.h shadow.h signal.h stropts.h termios.h \
2069-
unistd.h utime.h \
2069+
utime.h \
20702070
poll.h sys/devpoll.h sys/epoll.h sys/poll.h \
20712071
sys/audioio.h sys/xattr.h sys/bsdtty.h sys/event.h sys/file.h sys/ioctl.h \
20722072
sys/kern_control.h sys/loadavg.h sys/lock.h sys/mkdev.h sys/modem.h \

0 commit comments

Comments
 (0)