summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-14 14:57:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-05-14 14:57:53 +0000
commit642ddf7201445c6abd8b7afa6efdaa1e8f1bea67 (patch)
tree2af4ab7e7faed8c5211ff920bf6a3a1d43b28e67 /win32
parent9bbb8406cb1ded73ebdc10d565fdd1fc0f805cb8 (diff)
* configure.in: Check for the availability of pid_t, gid_t and uid_t and
remove AC_TYPE_UID_T. fixed: [ruby-core:04745] * defines.h: Remove pid_t typedef. * ruby.h: Define rb_pid_t, rb_gid_t and rb_uid_t in accordance with the available system types. * process.c: Change instances of pid_t and gid_t to their rb_* counterparts. * ext/pty/pty.c: Change pid_t to rb_pid_t. * vms/config.h: Define HAVE_{P,G,U}ID_T to 1. * win32/Makefile.sub: Remove #define for {g,u}id_t. * win32/win32.c: Change pid_t to rb_pid_t. * wince/Makefile.sub: Remove #define for {g,u}id_t. * wince/sys/types.h: Remove definitions of {p,g,u}id_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/Makefile.sub2
-rw-r--r--win32/win32.c20
2 files changed, 10 insertions, 12 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 660edd3a4a..ad18e9c89a 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -229,8 +229,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub
#define HAVE_FCNTL_H 1
#define HAVE_SYS_UTIME_H 1
#define HAVE_FLOAT_H 1
-#define uid_t int
-#define gid_t int
#define HAVE_STRUCT_STAT_ST_RDEV 1
#define HAVE_ST_RDEV 1
#define GETGROUPS_T int
diff --git a/win32/win32.c b/win32/win32.c
index d8d5dae027..aa3e94a839 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -445,7 +445,7 @@ getlogin()
static struct ChildRecord {
HANDLE hProcess; /* process handle */
- pid_t pid; /* process id */
+ rb_pid_t pid; /* process id */
} ChildRecord[MAXCHILDNUM];
#define FOREACH_CHILD(v) do { \
@@ -463,7 +463,7 @@ FindFirstChildSlot(void)
}
static struct ChildRecord *
-FindChildSlot(pid_t pid)
+FindChildSlot(rb_pid_t pid)
{
FOREACH_CHILD(child) {
@@ -678,7 +678,7 @@ rb_w32_join_argv(char *cmd, char *const *argv)
static int socketpair_internal(int af, int type, int protocol, SOCKET *sv);
-pid_t
+rb_pid_t
rb_w32_pipe_exec(const char *cmd, const char *prog, int mode, int *pipe)
{
struct ChildRecord* child;
@@ -987,7 +987,7 @@ CreateChild(const char *cmd, const char *prog, SECURITY_ATTRIBUTES *psa,
CloseHandle(aProcessInformation.hThread);
child->hProcess = aProcessInformation.hProcess;
- child->pid = (pid_t)aProcessInformation.dwProcessId;
+ child->pid = (rb_pid_t)aProcessInformation.dwProcessId;
if (!IsWinNT()) {
/* On Win9x, make pid positive similarly to cygwin and perl */
@@ -2577,7 +2577,7 @@ fcntl(int fd, int cmd, ...)
#define WNOHANG -1
#endif
-static pid_t
+static rb_pid_t
poll_child_status(struct ChildRecord *child, int *stat_loc)
{
DWORD exitcode;
@@ -2595,7 +2595,7 @@ poll_child_status(struct ChildRecord *child, int *stat_loc)
}
if (exitcode != STILL_ACTIVE) {
/* If already died, return immediatly. */
- pid_t pid = child->pid;
+ rb_pid_t pid = child->pid;
CloseChildHandle(child);
if (stat_loc) *stat_loc = exitcode << 8;
return pid;
@@ -2603,8 +2603,8 @@ poll_child_status(struct ChildRecord *child, int *stat_loc)
return 0;
}
-pid_t
-waitpid (pid_t pid, int *stat_loc, int options)
+rb_pid_t
+waitpid (rb_pid_t pid, int *stat_loc, int options)
{
DWORD timeout;
@@ -3435,10 +3435,10 @@ rb_w32_free_environ(char **env)
}
#undef getpid
-pid_t
+rb_pid_t
rb_w32_getpid(void)
{
- pid_t pid;
+ rb_pid_t pid;
pid = getpid();