detect getsid(2), also spotted by RT, this on MSYS

This commit is contained in:
tg 2013-11-30 17:41:35 +00:00
parent c4c4fd7365
commit 6217904193
6 changed files with 24 additions and 17 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.652 2013/11/30 15:42:18 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.653 2013/11/30 17:41:31 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013
@ -1762,7 +1762,7 @@ else
#define EXTERN
#define MKSH_INCLUDES_ONLY
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.652 2013/11/30 15:42:18 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.653 2013/11/30 17:41:31 tg Exp $");
int main(void) { printf("Hello, World!\n"); return (0); }
EOF
case $cm in
@ -1867,6 +1867,11 @@ ac_test getrusage <<-'EOF'
}
EOF
ac_test getsid <<-'EOF'
#include <unistd.h>
int main(void) { return ((int)getsid(0)); }
EOF
ac_test gettimeofday <<-'EOF'
#define MKSH_INCLUDES_ONLY
#include "sh.h"

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/Makefile,v 1.129 2013/11/30 15:42:19 tg Exp $
# $MirOS: src/bin/mksh/Makefile,v 1.130 2013/11/30 17:41:32 tg Exp $
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013
@ -47,9 +47,9 @@ CPPFLAGS+= -DMKSH_ASSUME_UTF8 -DMKSH_DISABLE_DEPRECATED \
-DHAVE_CAN_INT8TYPE=1 -DHAVE_CAN_UCBINT8=1 -DHAVE_RLIM_T=1 \
-DHAVE_SIG_T=1 -DHAVE_SYS_ERRLIST=1 -DHAVE_SYS_SIGNAME=1 \
-DHAVE_SYS_SIGLIST=1 -DHAVE_FLOCK=1 -DHAVE_LOCK_FCNTL=1 \
-DHAVE_GETRUSAGE=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_KILLPG=1 \
-DHAVE_MEMMOVE=1 -DHAVE_MKNOD=0 -DHAVE_MMAP=1 -DHAVE_NICE=1 \
-DHAVE_REVOKE=1 -DHAVE_SETLOCALE_CTYPE=0 \
-DHAVE_GETRUSAGE=1 -DHAVE_GETSID=1 -DHAVE_GETTIMEOFDAY=1 \
-DHAVE_KILLPG=1 -DHAVE_MEMMOVE=1 -DHAVE_MKNOD=0 -DHAVE_MMAP=1 \
-DHAVE_NICE=1 -DHAVE_REVOKE=1 -DHAVE_SETLOCALE_CTYPE=0 \
-DHAVE_LANGINFO_CODESET=0 -DHAVE_SELECT=1 -DHAVE_SETRESUGID=1 \
-DHAVE_SETGROUPS=1 -DHAVE_STRERROR=0 -DHAVE_STRSIGNAL=0 \
-DHAVE_STRLCPY=1 -DHAVE_FLOCK_DECL=1 -DHAVE_REVOKE_DECL=1 \

View File

@ -1,4 +1,4 @@
# $MirOS: src/bin/mksh/check.t,v 1.636 2013/11/30 00:20:46 tg Exp $
# $MirOS: src/bin/mksh/check.t,v 1.637 2013/11/30 17:41:32 tg Exp $
# $OpenBSD: bksl-nl.t,v 1.2 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: history.t,v 1.5 2001/01/28 23:04:56 niklas Exp $
# $OpenBSD: read.t,v 1.3 2003/03/10 03:48:16 david Exp $
@ -31,7 +31,7 @@
# http://www.freebsd.org/cgi/cvsweb.cgi/src/tools/regression/bin/test/regress.sh?rev=HEAD
expected-stdout:
@(#)MIRBSD KSH R48 2013/11/29
@(#)MIRBSD KSH R48 2013/11/30
description:
Check version of shell.
stdin:
@ -40,7 +40,7 @@ name: KSH_VERSION
category: shell:legacy-no
---
expected-stdout:
@(#)LEGACY KSH R48 2013/11/29
@(#)LEGACY KSH R48 2013/11/30
description:
Check version of legacy shell.
stdin:

View File

@ -38,7 +38,7 @@
#endif
#endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.251 2013/11/30 17:33:49 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.252 2013/11/30 17:41:34 tg Exp $");
#if HAVE_KILLPG
/*
@ -60,7 +60,7 @@ __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.251 2013/11/30 17:33:49 tg Exp $");
#define c_ulimit c_true
#endif
#ifndef MKSH_UNEMPLOYED
#if !defined(MKSH_UNEMPLOYED) && HAVE_GETSID
static int c_suspend(const char **);
#endif
@ -127,7 +127,7 @@ const struct builtin mkshbuiltins[] = {
{"*=return", c_exitreturn},
{Tsgset, c_set},
{"*=shift", c_shift},
#ifndef MKSH_UNEMPLOYED
#if !defined(MKSH_UNEMPLOYED) && HAVE_GETSID
{"suspend", c_suspend},
#endif
{"test", c_test},
@ -3719,7 +3719,7 @@ c_sleep(const char **wp)
}
#endif
#ifndef MKSH_UNEMPLOYED
#if !defined(MKSH_UNEMPLOYED) && HAVE_GETSID
static int
c_suspend(const char **wp)
{

4
jobs.c
View File

@ -23,7 +23,7 @@
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.102 2013/09/10 17:33:01 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/jobs.c,v 1.103 2013/11/30 17:41:35 tg Exp $");
#if HAVE_KILLPG
#define mksh_killpg killpg
@ -225,7 +225,7 @@ proc_errorlevel(Proc *p)
}
}
#ifndef MKSH_UNEMPLOYED
#if !defined(MKSH_UNEMPLOYED) && HAVE_GETSID
/* suspend the shell */
void
j_suspend(void)

6
sh.h
View File

@ -164,9 +164,9 @@
#endif
#ifdef EXTERN
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.678 2013/11/30 17:33:51 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/sh.h,v 1.679 2013/11/30 17:41:35 tg Exp $");
#endif
#define MKSH_VERSION "R48 2013/11/29"
#define MKSH_VERSION "R48 2013/11/30"
/* arithmetic types: C implementation */
#if !HAVE_CAN_INTTYPES
@ -1826,6 +1826,8 @@ int waitfor(const char *, int *);
int j_kill(const char *, int);
#ifndef MKSH_UNEMPLOYED
int j_resume(const char *, int);
#endif
#if !defined(MKSH_UNEMPLOYED) && HAVE_GETSID
void j_suspend(void);
#endif
int j_jobs(const char *, int, int);