Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
ad0ee836
Kaydet (Commit)
ad0ee836
authored
Mar 01, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
changes for NT/Borland C
üst
6964f73b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
21 deletions
+65
-21
posixmodule.c
Modules/posixmodule.c
+65
-21
No files found.
Modules/posixmodule.c
Dosyayı görüntüle @
ad0ee836
...
@@ -24,6 +24,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -24,6 +24,15 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
/* POSIX module implementation */
/* POSIX module implementation */
/* This file is also used for Windows NT. In that case the module
actually calls itself 'nt', not 'posix', and a few functions are
either unimplemented or implemented differently. The source
assumes that for Windows NT, the macro 'NT' is defined independent
of the compiler used. Different compilers define their own feature
test macro, e.g. '__BORLANDC__' or '_MSCVER'. */
/* For MS-DOS and Windows 3.x, use ../Dos/dosmodule.c */
#include "allobjects.h"
#include "allobjects.h"
#include "modsupport.h"
#include "modsupport.h"
#include "ceval.h"
#include "ceval.h"
...
@@ -39,9 +48,30 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
...
@@ -39,9 +48,30 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <fcntl.h>
#include <fcntl.h>
#endif
/* HAVE_FCNTL_H */
#endif
/* HAVE_FCNTL_H */
#ifndef NT
#define HAVE_FORK 1
#endif
#if !defined(NT) || defined(__BORLANDC__)
/* Unix functions that the configure script doesn't check for
and that aren't easily available under NT except with Borland C */
#define HAVE_GETEGID 1
#define HAVE_GETEUID 1
#define HAVE_GETGID 1
#define HAVE_GETPPID 1
#define HAVE_GETUID 1
#define HAVE_KILL 1
#define HAVE_WAIT 1
#endif
#ifndef NT
#ifndef NT
#ifdef HAVE_UNISTD_H
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#include <unistd.h>
/* XXX These are for SunOS4.1.3 but shouldn't hurt elsewhere */
extern
int
rename
();
extern
int
pclose
();
extern
int
lstat
();
extern
int
symlink
();
#else
/* !HAVE_UNISTD_H */
#else
/* !HAVE_UNISTD_H */
extern
int
mkdir
PROTO
((
const
char
*
,
mode_t
));
extern
int
mkdir
PROTO
((
const
char
*
,
mode_t
));
extern
int
chdir
PROTO
((
const
char
*
));
extern
int
chdir
PROTO
((
const
char
*
));
...
@@ -64,14 +94,6 @@ extern int lstat PROTO((const char *, struct stat *));
...
@@ -64,14 +94,6 @@ extern int lstat PROTO((const char *, struct stat *));
#endif
/* !HAVE_UNISTD_H */
#endif
/* !HAVE_UNISTD_H */
#endif
/* !NT */
#endif
/* !NT */
#ifndef NT
/* XXX These are for SunOS4.1.3 but shouldn't hurt elsewhere */
extern
int
rename
();
extern
int
pclose
();
extern
int
lstat
();
extern
int
symlink
();
#endif
/* !NT */
#ifdef HAVE_UTIME_H
#ifdef HAVE_UTIME_H
#include <utime.h>
#include <utime.h>
#endif
/* HAVE_UTIME_H */
#endif
/* HAVE_UTIME_H */
...
@@ -165,7 +187,9 @@ static object *PosixError; /* Exception posix.error */
...
@@ -165,7 +187,9 @@ static object *PosixError; /* Exception posix.error */
/* Set a POSIX-specific error from errno, and return NULL */
/* Set a POSIX-specific error from errno, and return NULL */
static
object
*
posix_error
()
{
return
err_errno
(
PosixError
);
static
object
*
posix_error
()
{
return
err_errno
(
PosixError
);
}
}
...
@@ -738,7 +762,7 @@ posix_execve(self, args)
...
@@ -738,7 +762,7 @@ posix_execve(self, args)
return
NULL
;
return
NULL
;
}
}
#if
ndef NT
#if
def HAVE_FORK
static
object
*
static
object
*
posix_fork
(
self
,
args
)
posix_fork
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -752,7 +776,9 @@ posix_fork(self, args)
...
@@ -752,7 +776,9 @@ posix_fork(self, args)
return
posix_error
();
return
posix_error
();
return
newintobject
((
long
)
pid
);
return
newintobject
((
long
)
pid
);
}
}
#endif
#ifdef HAVE_GETEGID
static
object
*
static
object
*
posix_getegid
(
self
,
args
)
posix_getegid
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -762,7 +788,9 @@ posix_getegid(self, args)
...
@@ -762,7 +788,9 @@ posix_getegid(self, args)
return
NULL
;
return
NULL
;
return
newintobject
((
long
)
getegid
());
return
newintobject
((
long
)
getegid
());
}
}
#endif
#ifdef HAVE_GETEUID
static
object
*
static
object
*
posix_geteuid
(
self
,
args
)
posix_geteuid
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -772,7 +800,9 @@ posix_geteuid(self, args)
...
@@ -772,7 +800,9 @@ posix_geteuid(self, args)
return
NULL
;
return
NULL
;
return
newintobject
((
long
)
geteuid
());
return
newintobject
((
long
)
geteuid
());
}
}
#endif
#ifdef HAVE_GETGID
static
object
*
static
object
*
posix_getgid
(
self
,
args
)
posix_getgid
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -782,7 +812,7 @@ posix_getgid(self, args)
...
@@ -782,7 +812,7 @@ posix_getgid(self, args)
return
NULL
;
return
NULL
;
return
newintobject
((
long
)
getgid
());
return
newintobject
((
long
)
getgid
());
}
}
#endif
/* !NT */
#endif
static
object
*
static
object
*
posix_getpid
(
self
,
args
)
posix_getpid
(
self
,
args
)
...
@@ -830,7 +860,7 @@ posix_setpgrp(self, args)
...
@@ -830,7 +860,7 @@ posix_setpgrp(self, args)
#endif
/* HAVE_SETPGRP */
#endif
/* HAVE_SETPGRP */
#if
ndef NT
#if
def HAVE_GETPPID
static
object
*
static
object
*
posix_getppid
(
self
,
args
)
posix_getppid
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -840,7 +870,9 @@ posix_getppid(self, args)
...
@@ -840,7 +870,9 @@ posix_getppid(self, args)
return
NULL
;
return
NULL
;
return
newintobject
((
long
)
getppid
());
return
newintobject
((
long
)
getppid
());
}
}
#endif
#ifdef HAVE_GETUID
static
object
*
static
object
*
posix_getuid
(
self
,
args
)
posix_getuid
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -850,7 +882,9 @@ posix_getuid(self, args)
...
@@ -850,7 +882,9 @@ posix_getuid(self, args)
return
NULL
;
return
NULL
;
return
newintobject
((
long
)
getuid
());
return
newintobject
((
long
)
getuid
());
}
}
#endif
#ifdef HAVE_KILL
static
object
*
static
object
*
posix_kill
(
self
,
args
)
posix_kill
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -864,7 +898,7 @@ posix_kill(self, args)
...
@@ -864,7 +898,7 @@ posix_kill(self, args)
INCREF
(
None
);
INCREF
(
None
);
return
None
;
return
None
;
}
}
#endif
/* !NT */
#endif
static
object
*
static
object
*
posix_popen
(
self
,
args
)
posix_popen
(
self
,
args
)
...
@@ -940,7 +974,7 @@ posix_waitpid(self, args)
...
@@ -940,7 +974,7 @@ posix_waitpid(self, args)
}
}
#endif
/* HAVE_WAITPID */
#endif
/* HAVE_WAITPID */
#if
ndef N
T
#if
def HAVE_WAI
T
static
object
*
static
object
*
posix_wait
(
self
,
args
)
posix_wait
(
self
,
args
)
object
*
self
;
object
*
self
;
...
@@ -955,7 +989,7 @@ posix_wait(self, args)
...
@@ -955,7 +989,7 @@ posix_wait(self, args)
else
else
return
mkvalue
(
"ii"
,
pid
,
sts
);
return
mkvalue
(
"ii"
,
pid
,
sts
);
}
}
#endif
/* !NT */
#endif
static
object
*
static
object
*
posix_lstat
(
self
,
args
)
posix_lstat
(
self
,
args
)
...
@@ -1366,21 +1400,31 @@ static struct methodlist posix_methods[] = {
...
@@ -1366,21 +1400,31 @@ static struct methodlist posix_methods[] = {
{
"_exit"
,
posix__exit
},
{
"_exit"
,
posix__exit
},
{
"execv"
,
posix_execv
},
{
"execv"
,
posix_execv
},
{
"execve"
,
posix_execve
},
{
"execve"
,
posix_execve
},
#if
ndef NT
#if
def HAVE_FORK
{
"fork"
,
posix_fork
},
{
"fork"
,
posix_fork
},
#endif
/* HAVE_FORK */
#ifdef HAVE_GETEGID
{
"getegid"
,
posix_getegid
},
{
"getegid"
,
posix_getegid
},
#endif
/* HAVE_GETEGID */
#ifdef HAVE_GETEUID
{
"geteuid"
,
posix_geteuid
},
{
"geteuid"
,
posix_geteuid
},
#endif
/* HAVE_GETEUID */
#ifdef HAVE_GETGID
{
"getgid"
,
posix_getgid
},
{
"getgid"
,
posix_getgid
},
#endif
/*
!NT
*/
#endif
/*
HAVE_GETGID
*/
{
"getpid"
,
posix_getpid
},
{
"getpid"
,
posix_getpid
},
#ifdef HAVE_GETPGRP
#ifdef HAVE_GETPGRP
{
"getpgrp"
,
posix_getpgrp
},
{
"getpgrp"
,
posix_getpgrp
},
#endif
/* HAVE_GETPGRP */
#endif
/* HAVE_GETPGRP */
#if
ndef NT
#if
def HAVE_GETPPID
{
"getppid"
,
posix_getppid
},
{
"getppid"
,
posix_getppid
},
#endif
/* HAVE_GETPPID */
#ifdef HAVE_GETUID
{
"getuid"
,
posix_getuid
},
{
"getuid"
,
posix_getuid
},
#endif
/* HAVE_GETUID */
#ifdef HAVE_KILL
{
"kill"
,
posix_kill
},
{
"kill"
,
posix_kill
},
#endif
/*
!NT
*/
#endif
/*
HAVE_KILL
*/
{
"popen"
,
posix_popen
,
1
},
{
"popen"
,
posix_popen
,
1
},
#ifdef HAVE_SETUID
#ifdef HAVE_SETUID
{
"setuid"
,
posix_setuid
},
{
"setuid"
,
posix_setuid
},
...
@@ -1391,9 +1435,9 @@ static struct methodlist posix_methods[] = {
...
@@ -1391,9 +1435,9 @@ static struct methodlist posix_methods[] = {
#ifdef HAVE_SETPGRP
#ifdef HAVE_SETPGRP
{
"setpgrp"
,
posix_setpgrp
},
{
"setpgrp"
,
posix_setpgrp
},
#endif
/* HAVE_SETPGRP */
#endif
/* HAVE_SETPGRP */
#if
ndef N
T
#if
def HAVE_WAI
T
{
"wait"
,
posix_wait
},
{
"wait"
,
posix_wait
},
#endif
/*
!N
T */
#endif
/*
HAVE_WAI
T */
#ifdef HAVE_WAITPID
#ifdef HAVE_WAITPID
{
"waitpid"
,
posix_waitpid
},
{
"waitpid"
,
posix_waitpid
},
#endif
/* HAVE_WAITPID */
#endif
/* HAVE_WAITPID */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment