mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-19 19:34:18 +08:00
321 lines
8.8 KiB
Diff
321 lines
8.8 KiB
Diff
diff -ru source/ext/POSIX/POSIX.xs source-new/ext/POSIX/POSIX.xs
|
|
--- source/ext/POSIX/POSIX.xs 2017-06-30 14:03:22.000000000 -0700
|
|
+++ source-new/ext/POSIX/POSIX.xs 2017-08-17 19:21:59.498359355 -0700
|
|
@@ -1302,6 +1302,7 @@
|
|
#endif
|
|
#include <fcntl.h>
|
|
|
|
+#if 0
|
|
#ifdef HAS_TZNAME
|
|
# if !defined(WIN32) && !defined(__CYGWIN__) && !defined(NETWARE) && !defined(__UWIN__)
|
|
extern char *tzname[];
|
|
@@ -1311,6 +1312,7 @@
|
|
char *tzname[] = { "" , "" };
|
|
#endif
|
|
#endif
|
|
+#endif
|
|
|
|
#if defined(__VMS) && !defined(__POSIX_SOURCE)
|
|
|
|
@@ -1327,10 +1329,11 @@
|
|
#if defined (__CYGWIN__)
|
|
# define tzname _tzname
|
|
#endif
|
|
-#if defined (WIN32) || defined (NETWARE)
|
|
+#if 1
|
|
# undef mkfifo
|
|
# define mkfifo(a,b) not_here("mkfifo")
|
|
# define ttyname(a) (char*)not_here("ttyname")
|
|
+# define pause() not_here("pause")
|
|
# define sigset_t long
|
|
# define pid_t long
|
|
# ifdef _MSC_VER
|
|
@@ -1397,7 +1400,7 @@
|
|
typedef HV* POSIX__SigAction;
|
|
typedef int POSIX__SigNo;
|
|
typedef int POSIX__Fd;
|
|
-#ifdef I_TERMIOS
|
|
+#if 0
|
|
typedef struct termios* POSIX__Termios;
|
|
#else /* Define termios types to int, and call not_here for the functions.*/
|
|
#define POSIX__Termios int
|
|
@@ -1829,7 +1832,7 @@
|
|
const char * packname
|
|
CODE:
|
|
{
|
|
-#ifdef I_TERMIOS
|
|
+#if 0
|
|
void *const p = allocate_struct(aTHX_ (ST(0) = sv_newmortal()),
|
|
sizeof(struct termios), packname);
|
|
/* The previous implementation stored a pointer to an uninitialised
|
|
@@ -1896,7 +1899,7 @@
|
|
getcflag = 2
|
|
getlflag = 3
|
|
CODE:
|
|
-#ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
|
|
+#if 0 /* References a termios structure member so ifdef it out. */
|
|
switch(ix) {
|
|
case 0:
|
|
RETVAL = termios_ref->c_iflag;
|
|
@@ -1925,7 +1928,7 @@
|
|
POSIX::Termios termios_ref
|
|
unsigned int ccix
|
|
CODE:
|
|
-#ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
|
|
+#if 0 /* References a termios structure member so ifdef it out. */
|
|
if (ccix >= NCCS)
|
|
croak("Bad getcc subscript");
|
|
RETVAL = termios_ref->c_cc[ccix];
|
|
@@ -1957,7 +1960,7 @@
|
|
setcflag = 2
|
|
setlflag = 3
|
|
CODE:
|
|
-#ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
|
|
+#if 0 /* References a termios structure member so ifdef it out. */
|
|
switch(ix) {
|
|
case 0:
|
|
termios_ref->c_iflag = flag;
|
|
@@ -1982,7 +1985,7 @@
|
|
unsigned int ccix
|
|
cc_t cc
|
|
CODE:
|
|
-#ifdef I_TERMIOS /* References a termios structure member so ifdef it out. */
|
|
+#if 0 /* References a termios structure member so ifdef it out. */
|
|
if (ccix >= NCCS)
|
|
croak("Bad setcc subscript");
|
|
termios_ref->c_cc[ccix] = cc;
|
|
@@ -3540,15 +3543,15 @@
|
|
void
|
|
times()
|
|
PPCODE:
|
|
- struct tms tms;
|
|
- clock_t realtime;
|
|
- realtime = times( &tms );
|
|
+ //struct tms tms;
|
|
+ //clock_t realtime;
|
|
+ //realtime = times( &tms );
|
|
EXTEND(SP,5);
|
|
- PUSHs( sv_2mortal( newSViv( (IV) realtime ) ) );
|
|
- PUSHs( sv_2mortal( newSViv( (IV) tms.tms_utime ) ) );
|
|
- PUSHs( sv_2mortal( newSViv( (IV) tms.tms_stime ) ) );
|
|
- PUSHs( sv_2mortal( newSViv( (IV) tms.tms_cutime ) ) );
|
|
- PUSHs( sv_2mortal( newSViv( (IV) tms.tms_cstime ) ) );
|
|
+ PUSHs( sv_2mortal( newSViv( (IV) 0 ) ) );
|
|
+ PUSHs( sv_2mortal( newSViv( (IV) 0 ) ) );
|
|
+ PUSHs( sv_2mortal( newSViv( (IV) 0 ) ) );
|
|
+ PUSHs( sv_2mortal( newSViv( (IV) 0 ) ) );
|
|
+ PUSHs( sv_2mortal( newSViv( (IV) 0 ) ) );
|
|
|
|
double
|
|
difftime(time1, time2)
|
|
diff -ru source/mg.c source-new/mg.c
|
|
--- source/mg.c 2017-06-30 14:03:22.000000000 -0700
|
|
+++ source-new/mg.c 2017-08-17 14:40:37.669507085 -0700
|
|
@@ -3034,16 +3034,16 @@
|
|
#ifdef HAS_SETRESUID
|
|
PERL_UNUSED_RESULT(setresuid(new_uid, (Uid_t)-1, (Uid_t)-1));
|
|
#else
|
|
- if (new_uid == PerlProc_geteuid()) { /* special case $< = $> */
|
|
+// if (new_uid == PerlProc_geteuid()) { /* special case $< = $> */
|
|
#ifdef PERL_DARWIN
|
|
/* workaround for Darwin's setuid peculiarity, cf [perl #24122] */
|
|
if (new_uid != 0 && PerlProc_getuid() == 0)
|
|
PERL_UNUSED_RESULT(PerlProc_setuid(0));
|
|
#endif
|
|
- PERL_UNUSED_RESULT(PerlProc_setuid(new_uid));
|
|
- } else {
|
|
+// PERL_UNUSED_RESULT(PerlProc_setuid(new_uid));
|
|
+// } else {
|
|
Perl_croak(aTHX_ "setruid() not implemented");
|
|
- }
|
|
+// }
|
|
#endif
|
|
#endif
|
|
#endif
|
|
@@ -3067,11 +3067,11 @@
|
|
#ifdef HAS_SETRESUID
|
|
PERL_UNUSED_RESULT(setresuid((Uid_t)-1, new_euid, (Uid_t)-1));
|
|
#else
|
|
- if (new_euid == PerlProc_getuid()) /* special case $> = $< */
|
|
- PERL_UNUSED_RESULT(PerlProc_setuid(new_euid));
|
|
- else {
|
|
+// if (new_euid == PerlProc_getuid()) /* special case $> = $< */
|
|
+// PERL_UNUSED_RESULT(PerlProc_setuid(new_euid));
|
|
+// else {
|
|
Perl_croak(aTHX_ "seteuid() not implemented");
|
|
- }
|
|
+// }
|
|
#endif
|
|
#endif
|
|
#endif
|
|
@@ -3095,11 +3095,11 @@
|
|
#ifdef HAS_SETRESGID
|
|
PERL_UNUSED_RESULT(setresgid(new_gid, (Gid_t)-1, (Gid_t) -1));
|
|
#else
|
|
- if (new_gid == PerlProc_getegid()) /* special case $( = $) */
|
|
- PERL_UNUSED_RESULT(PerlProc_setgid(new_gid));
|
|
- else {
|
|
+// if (new_gid == PerlProc_getegid()) /* special case $( = $) */
|
|
+// PERL_UNUSED_RESULT(PerlProc_setgid(new_gid));
|
|
+// else {
|
|
Perl_croak(aTHX_ "setrgid() not implemented");
|
|
- }
|
|
+// }
|
|
#endif
|
|
#endif
|
|
#endif
|
|
@@ -3178,11 +3178,11 @@
|
|
#ifdef HAS_SETRESGID
|
|
PERL_UNUSED_RESULT(setresgid((Gid_t)-1, new_egid, (Gid_t)-1));
|
|
#else
|
|
- if (new_egid == PerlProc_getgid()) /* special case $) = $( */
|
|
- PERL_UNUSED_RESULT(PerlProc_setgid(new_egid));
|
|
- else {
|
|
+// if (new_egid == PerlProc_getgid()) /* special case $) = $( */
|
|
+// PERL_UNUSED_RESULT(PerlProc_setgid(new_egid));
|
|
+// else {
|
|
Perl_croak(aTHX_ "setegid() not implemented");
|
|
- }
|
|
+// }
|
|
#endif
|
|
#endif
|
|
#endif
|
|
diff -ru source/perl.h source-new/perl.h
|
|
--- source/perl.h 2017-06-30 14:03:22.000000000 -0700
|
|
+++ source-new/perl.h 2017-08-17 13:14:01.806883580 -0700
|
|
@@ -1061,7 +1061,6 @@
|
|
#ifndef PERL_MICRO
|
|
#ifndef memchr
|
|
# ifndef HAS_MEMCHR
|
|
-# define memchr(s,c,n) ninstr((char*)(s), ((char*)(s)) + n, &(c), &(c) + 1)
|
|
# endif
|
|
#endif
|
|
#endif
|
|
diff -ru source/pp_hot.c source-new/pp_hot.c
|
|
--- source/pp_hot.c 2017-06-30 14:03:22.000000000 -0700
|
|
+++ source-new/pp_hot.c 2017-08-17 13:16:20.234635700 -0700
|
|
@@ -1583,11 +1583,13 @@
|
|
PL_delaymagic &= ~DM_EUID;
|
|
}
|
|
# endif /* HAS_SETEUID */
|
|
+#if 0
|
|
if (PL_delaymagic & DM_UID) {
|
|
if (PL_delaymagic_uid != PL_delaymagic_euid)
|
|
DIE(aTHX_ "No setreuid available");
|
|
PERL_UNUSED_RESULT(PerlProc_setuid(PL_delaymagic_uid));
|
|
}
|
|
+#endif
|
|
# endif /* HAS_SETREUID */
|
|
#endif /* HAS_SETRESUID */
|
|
|
|
@@ -1619,11 +1621,13 @@
|
|
PL_delaymagic &= ~DM_EGID;
|
|
}
|
|
# endif /* HAS_SETEGID */
|
|
+#if 0
|
|
if (PL_delaymagic & DM_GID) {
|
|
if (PL_delaymagic_gid != PL_delaymagic_egid)
|
|
DIE(aTHX_ "No setregid available");
|
|
PERL_UNUSED_RESULT(PerlProc_setgid(PL_delaymagic_gid));
|
|
}
|
|
+#endif
|
|
# endif /* HAS_SETREGID */
|
|
#endif /* HAS_SETRESGID */
|
|
|
|
diff -ru source/pp_sys.c source-new/pp_sys.c
|
|
--- source/pp_sys.c 2017-06-30 14:03:22.000000000 -0700
|
|
+++ source-new/pp_sys.c 2017-08-17 14:57:00.983541027 -0700
|
|
@@ -2413,7 +2413,7 @@
|
|
TAINT_PROPER(PL_op_desc[optype]);
|
|
|
|
if (optype == OP_IOCTL)
|
|
-#ifdef HAS_IOCTL
|
|
+#if 0
|
|
retval = PerlLIO_ioctl(PerlIO_fileno(IoIFP(io)), func, s);
|
|
#else
|
|
DIE(aTHX_ "ioctl is not implemented");
|
|
@@ -2705,7 +2705,7 @@
|
|
if (!IoIFP(io))
|
|
goto nuts;
|
|
|
|
- PUSHi( PerlSock_shutdown(PerlIO_fileno(IoIFP(io)), how) >= 0 );
|
|
+ PUSHi( 0 );
|
|
RETURN;
|
|
|
|
nuts:
|
|
@@ -2980,7 +2980,7 @@
|
|
sv_setuid(PUSHmortal, PL_statcache.st_uid);
|
|
sv_setgid(PUSHmortal, PL_statcache.st_gid);
|
|
|
|
-#ifdef USE_STAT_RDEV
|
|
+#if 0
|
|
mPUSHi(PL_statcache.st_rdev);
|
|
#else
|
|
PUSHs(newSVpvs_flags("", SVs_TEMP));
|
|
@@ -4186,7 +4186,7 @@
|
|
|
|
PP(pp_fork)
|
|
{
|
|
-#ifdef HAS_FORK
|
|
+#if 1
|
|
dSP; dTARGET;
|
|
Pid_t childpid;
|
|
#ifdef HAS_SIGPROCMASK
|
|
@@ -4332,7 +4332,7 @@
|
|
TAINT_PROPER("system");
|
|
}
|
|
PERL_FLUSHALL_FOR_CHILD;
|
|
-#if (defined(HAS_FORK) || defined(__amigaos4__)) && !defined(VMS) && !defined(OS2) || defined(PERL_MICRO)
|
|
+#if 1
|
|
{
|
|
#ifdef __amigaos4__
|
|
struct UserData userdata;
|
|
@@ -5582,7 +5582,7 @@
|
|
|
|
PP(pp_ggrent)
|
|
{
|
|
-#ifdef HAS_GROUP
|
|
+#if 0
|
|
dSP;
|
|
const I32 which = PL_op->op_type;
|
|
const struct group *grent;
|
|
diff -ru source/util.c source-new/util.c
|
|
--- source/util.c 2017-06-30 14:03:22.000000000 -0700
|
|
+++ source-new/util.c 2017-08-17 15:42:05.328932377 -0700
|
|
@@ -2456,7 +2456,7 @@
|
|
PerlIO *
|
|
Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
|
|
{
|
|
-#if (!defined(DOSISH) || defined(HAS_FORK)) && !defined(OS2) && !defined(VMS) && !defined(NETWARE) && !defined(__LIBCATAMOUNT__) && !defined(__amigaos4__)
|
|
+#if 1
|
|
int p[2];
|
|
I32 This, that;
|
|
Pid_t pid;
|
|
@@ -2821,7 +2821,7 @@
|
|
Pid_t
|
|
Perl_my_fork(void)
|
|
{
|
|
-#if defined(HAS_FORK)
|
|
+#if 1
|
|
Pid_t pid;
|
|
#if defined(USE_ITHREADS) && !defined(HAS_PTHREAD_ATFORK)
|
|
atfork_lock();
|
|
@@ -2842,7 +2842,7 @@
|
|
#endif /* HAS_FORK */
|
|
}
|
|
|
|
-#ifndef HAS_DUP2
|
|
+#if 0
|
|
int
|
|
dup2(int oldfd, int newfd)
|
|
{
|
|
@@ -3196,7 +3196,7 @@
|
|
|
|
#if defined(OS2)
|
|
int pclose();
|
|
-#ifdef HAS_FORK
|
|
+#if 1
|
|
int /* Cannot prototype with I32
|
|
in os2ish.h. */
|
|
my_syspclose(PerlIO *ptr)
|