diff --git a/headers/compatibility/bsd/libutil.h b/headers/compatibility/bsd/libutil.h index 1e2fb73f70..8a06159548 100644 --- a/headers/compatibility/bsd/libutil.h +++ b/headers/compatibility/bsd/libutil.h @@ -52,15 +52,13 @@ typedef struct _property { char *value; } *properties; -#ifdef _SYS_PARAM_H_ /* for pidfile.c */ struct pidfh { int pf_fd; char pf_path[MAXPATHLEN + 1]; - __dev_t pf_dev; + dev_t pf_dev; ino_t pf_ino; }; -#endif /* Avoid pulling in all the include files for no need */ struct termios; @@ -120,12 +118,10 @@ const char *pw_tempname(void); int pw_tmp(int _mfd); #endif -#ifdef _SYS_PARAM_H_ struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr); int pidfile_write(struct pidfh *pfh); int pidfile_close(struct pidfh *pfh); int pidfile_remove(struct pidfh *pfh); -#endif __END_DECLS diff --git a/headers/compatibility/bsd/netinet/in_systm.h b/headers/compatibility/bsd/netinet/in_systm.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/headers/compatibility/bsd/sys/param.h b/headers/compatibility/bsd/sys/param.h index 37858057bf..4be424684b 100644 --- a/headers/compatibility/bsd/sys/param.h +++ b/headers/compatibility/bsd/sys/param.h @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _BSD_SYS_PARAM_H_ @@ -27,4 +27,8 @@ # define howmany(x, y) (((x) + ((y) - 1)) / (y)) #endif +#ifndef MAXLOGNAME +# define MAXLOGNAME 32 +#endif + #endif /* _BSD_SYS_PARAM_H_ */ diff --git a/headers/compatibility/bsd/unistd.h b/headers/compatibility/bsd/unistd.h index 960d5895f4..67780f5f05 100644 --- a/headers/compatibility/bsd/unistd.h +++ b/headers/compatibility/bsd/unistd.h @@ -1,5 +1,5 @@ /* - * Copyright 2006, Haiku, Inc. All Rights Reserved. + * Copyright 2006-2008, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ #ifndef _BSD_UNISTD_H_ @@ -9,12 +9,20 @@ #include_next +#define L_SET SEEK_SET +#define L_INCR SEEK_CUR +#define L_XTND SEEK_END + + #ifdef __cplusplus extern "C" { #endif +void endusershell(void); char *getpass(const char *prompt); +char *getusershell(void); int issetugid(void); +void setusershell(void); #ifdef __cplusplus } diff --git a/src/libs/bsd/Jamfile b/src/libs/bsd/Jamfile index b9e3fa1551..c5b6c2b53d 100644 --- a/src/libs/bsd/Jamfile +++ b/src/libs/bsd/Jamfile @@ -14,5 +14,6 @@ SharedLibrary libbsd.so : signal.c stringlist.c unvis.c + usershell.c vis.c ; diff --git a/src/libs/bsd/usershell.c b/src/libs/bsd/usershell.c new file mode 100644 index 0000000000..4eb5dd817b --- /dev/null +++ b/src/libs/bsd/usershell.c @@ -0,0 +1,39 @@ +/* + * Copyright 2008, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Axel Dörfler, axeld@pinc-software.de + */ + + +#include + + +static int sShellIndex; + + +char * +getusershell(void) +{ + if (sShellIndex++ == 0) + return "/bin/sh"; + + return NULL; +} + + +void +endusershell(void) +{ + sShellIndex = 0; +} + + +void +setusershell(void) +{ + sShellIndex = 0; +} + +