Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36bc680

Browse files
committed
sys/wait.h; NeXT changes (no unistd, utime; getcwd?)
1 parent 4a26986 commit 36bc680

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Modules/posixmodule.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4141
#include <errno.h>
4242
#include <sys/types.h>
4343
#include <sys/stat.h>
44+
#ifdef HAVE_SYS_WAIT_H
45+
#include <sys/wait.h> /* For WNOHANG */
46+
#endif
4447

4548
#include "mytime.h" /* For clock_t on some systems */
4649

@@ -64,11 +67,23 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6467
#define HAVE_WAIT 1
6568
#define HAVE_OPENDIR 1
6669
#define HAVE_PIPE 1
70+
#define HAVE_GETCWD 1
6771
#endif
6872

6973
#ifndef NT
74+
7075
#ifdef HAVE_UNISTD_H
7176
#include <unistd.h>
77+
#endif
78+
79+
#ifdef NeXT
80+
/* NeXT's <unistd.h> and <utime.h> aren't worth much */
81+
#undef HAVE_UNISTD_H
82+
#undef HAVE_UTIME_H
83+
/* #undef HAVE_GETCWD */
84+
#endif
85+
86+
#ifdef HAVE_UNISTD_H
7287
/* XXX These are for SunOS4.1.3 but shouldn't hurt elsewhere */
7388
extern int rename();
7489
extern int pclose();
@@ -94,6 +109,7 @@ extern int symlink PROTO((const char *, const char *));
94109
extern int lstat PROTO((const char *, struct stat *));
95110
#endif /* HAVE_LSTAT */
96111
#endif /* !HAVE_UNISTD_H */
112+
97113
#endif /* !NT */
98114

99115
#ifdef HAVE_UTIME_H
@@ -329,6 +345,7 @@ posix_chown(self, args)
329345
}
330346
#endif /* HAVE_CHOWN */
331347

348+
#ifdef HAVE_GETCWD
332349
static object *
333350
posix_getcwd(self, args)
334351
object *self;
@@ -345,6 +362,7 @@ posix_getcwd(self, args)
345362
return posix_error();
346363
return newstringobject(buf);
347364
}
365+
#endif
348366

349367
#ifdef HAVE_LINK
350368
static object *
@@ -1370,7 +1388,9 @@ static struct methodlist posix_methods[] = {
13701388
#ifdef HAVE_CHOWN
13711389
{"chown", posix_chown},
13721390
#endif /* HAVE_CHOWN */
1391+
#ifdef HAVE_GETCWD
13731392
{"getcwd", posix_getcwd},
1393+
#endif
13741394
#ifdef HAVE_LINK
13751395
{"link", posix_link},
13761396
#endif /* HAVE_LINK */

0 commit comments

Comments
 (0)