bsd-misc.h revision 221420
1221420Sdes/* $Id: bsd-misc.h,v 1.19 2010/11/08 22:26:23 tim Exp $ */ 2124208Sdes 398937Sdes/* 4126274Sdes * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> 598937Sdes * 6126274Sdes * Permission to use, copy, modify, and distribute this software for any 7126274Sdes * purpose with or without fee is hereby granted, provided that the above 8126274Sdes * copyright notice and this permission notice appear in all copies. 998937Sdes * 10126274Sdes * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11126274Sdes * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12126274Sdes * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13126274Sdes * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14126274Sdes * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15126274Sdes * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16126274Sdes * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1798937Sdes */ 1898937Sdes 1998937Sdes#ifndef _BSD_MISC_H 2098937Sdes#define _BSD_MISC_H 2198937Sdes 22124208Sdes#include "includes.h" 2398937Sdes 24124208Sdeschar *ssh_get_progname(char *); 2598937Sdes 2698937Sdes#ifndef HAVE_SETSID 2798937Sdes#define setsid() setpgrp(0, getpid()) 2898937Sdes#endif /* !HAVE_SETSID */ 2998937Sdes 3098937Sdes#ifndef HAVE_SETENV 31124208Sdesint setenv(const char *, const char *, int); 3298937Sdes#endif /* !HAVE_SETENV */ 3398937Sdes 3498937Sdes#ifndef HAVE_SETLOGIN 35124208Sdesint setlogin(const char *); 3698937Sdes#endif /* !HAVE_SETLOGIN */ 3798937Sdes 3898937Sdes#ifndef HAVE_INNETGR 39124208Sdesint innetgr(const char *, const char *, const char *, const char *); 4098937Sdes#endif /* HAVE_INNETGR */ 4198937Sdes 4298937Sdes#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) 43124208Sdesint seteuid(uid_t); 4498937Sdes#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */ 4598937Sdes 4698937Sdes#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) 47124208Sdesint setegid(uid_t); 4898937Sdes#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */ 4998937Sdes 5098937Sdes#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR) 51124208Sdesconst char *strerror(int); 5298937Sdes#endif 5398937Sdes 5498937Sdes 5598937Sdes#ifndef HAVE_UTIMES 5698937Sdes#ifndef HAVE_STRUCT_TIMEVAL 5798937Sdesstruct timeval { 5898937Sdes long tv_sec; 5998937Sdes long tv_usec; 6098937Sdes} 6198937Sdes#endif /* HAVE_STRUCT_TIMEVAL */ 6298937Sdes 63124208Sdesint utimes(char *, struct timeval *); 6498937Sdes#endif /* HAVE_UTIMES */ 6598937Sdes 6698937Sdes#ifndef HAVE_TRUNCATE 67124208Sdesint truncate (const char *, off_t); 6898937Sdes#endif /* HAVE_TRUNCATE */ 6998937Sdes 70113908Sdes#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP) 71113908Sdes#ifndef HAVE_STRUCT_TIMESPEC 72113908Sdesstruct timespec { 73113908Sdes time_t tv_sec; 74113908Sdes long tv_nsec; 75113908Sdes}; 76113908Sdes#endif 77124208Sdesint nanosleep(const struct timespec *, struct timespec *); 78113908Sdes#endif 7998937Sdes 80124208Sdes#ifndef HAVE_TCGETPGRP 81124208Sdespid_t tcgetpgrp(int); 82124208Sdes#endif 83124208Sdes 84124208Sdes#ifndef HAVE_TCSENDBREAK 85124208Sdesint tcsendbreak(int, int); 86124208Sdes#endif 87124208Sdes 88128456Sdes#ifndef HAVE_UNSETENV 89128456Sdesvoid unsetenv(const char *); 90128456Sdes#endif 91128456Sdes 92124208Sdes/* wrapper for signal interface */ 93124208Sdestypedef void (*mysig_t)(int); 94124208Sdesmysig_t mysignal(int sig, mysig_t act); 95124208Sdes 96124208Sdes#define signal(a,b) mysignal(a,b) 97124208Sdes 98221420Sdes#ifndef HAVE_ISBLANK 99221420Sdesint isblank(int); 100221420Sdes#endif 101221420Sdes 10298937Sdes#endif /* _BSD_MISC_H */ 103