#include <krb5/libos.h>
#include <stdio.h>
-#ifdef POSIX
+
+#include <krb5/posix-conf.h>
+
+#ifdef POSIX_FILE_LOCKS
#include <errno.h>
#include <fcntl.h>
#define SHARED_LOCK F_RDLCK
char *pathname;
int mode;
{
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
int lock_cmd = F_SETLKW;
struct flock lock_arg;
#define lock_flag lock_arg.l_type
return(KRB5_LIBOS_BADLOCKFLAG);
if (mode & KRB5_LOCKMODE_DONTBLOCK) {
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
lock_cmd = F_SETLK;
#else
lock_flag |= LOCK_NB;
#endif
}
-#ifdef POSIX
+#ifdef POSIX_FILE_LOCKS
lock_arg.l_whence = 0;
lock_arg.l_start = 0;
lock_arg.l_len = 0;
#include <setjmp.h>
#include <krb5/ext-proto.h>
+#include <krb5/posix-conf.h>
-#ifdef POSIX
+#ifdef POSIX_TERMIOS
#include <termios.h>
-#define sigtype void
#else
#include <sys/ioctl.h>
-#define sigtype int
-#endif /* POSIX */
+#endif /* POSIX_TERMIOS */
extern int errno;
-#ifdef POSIX
+#ifdef POSIX_TERMIOS
#define cleanup(errcode) (void) signal(SIGINT, ointrfunc); tcsetattr(0, TCSANOW, &save_control); return errcode;
#else
#define cleanup(errcode) (void) signal(SIGINT, ointrfunc); ioctl(0, TIOCSETP, (char *)&tty_savestate); return errcode;
static jmp_buf pwd_jump;
-static sigtype
+static krb5_sigtype
intr_routine()
{
longjmp(pwd_jump, 1);
char *readin_string = 0;
register char *ptr;
int scratchchar;
- sigtype (*ointrfunc)();
-#ifdef POSIX
+ krb5_sigtype (*ointrfunc)();
+#ifdef POSIX_TERMIOS
struct termios echo_control, save_control;
if (tcgetattr(0, &echo_control) == -1)
/* reset intrfunc */
(void) signal(SIGINT, ointrfunc);
-#ifdef POSIX
+#ifdef POSIX_TERMIOS
if (tcsetattr(0, TCSANOW, &save_control) == -1)
return errno;
#else