bsd-misc.h revision 98937
198937Sdes/*
298937Sdes * Copyright (c) 1999-2000 Damien Miller.  All rights reserved.
398937Sdes *
498937Sdes * Redistribution and use in source and binary forms, with or without
598937Sdes * modification, are permitted provided that the following conditions
698937Sdes * are met:
798937Sdes * 1. Redistributions of source code must retain the above copyright
898937Sdes *    notice, this list of conditions and the following disclaimer.
998937Sdes * 2. Redistributions in binary form must reproduce the above copyright
1098937Sdes *    notice, this list of conditions and the following disclaimer in the
1198937Sdes *    documentation and/or other materials provided with the distribution.
1298937Sdes *
1398937Sdes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1498937Sdes * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1598937Sdes * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1698937Sdes * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1798937Sdes * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1898937Sdes * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1998937Sdes * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2098937Sdes * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2198937Sdes * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2298937Sdes * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2398937Sdes */
2498937Sdes
2598937Sdes/* $Id: bsd-misc.h,v 1.6 2002/06/13 21:34:58 mouring Exp $ */
2698937Sdes
2798937Sdes#ifndef _BSD_MISC_H
2898937Sdes#define _BSD_MISC_H
2998937Sdes
3098937Sdes#include "config.h"
3198937Sdes
3298937Sdeschar *get_progname(char *argv0);
3398937Sdes
3498937Sdes#ifndef HAVE_SETSID
3598937Sdes#define setsid() setpgrp(0, getpid())
3698937Sdes#endif /* !HAVE_SETSID */
3798937Sdes
3898937Sdes#ifndef HAVE_SETENV
3998937Sdesint setenv(const char *name, const char *value, int overwrite);
4098937Sdes#endif /* !HAVE_SETENV */
4198937Sdes
4298937Sdes#ifndef HAVE_SETLOGIN
4398937Sdesint setlogin(const char *name);
4498937Sdes#endif /* !HAVE_SETLOGIN */
4598937Sdes
4698937Sdes#ifndef HAVE_INNETGR
4798937Sdesint innetgr(const char *netgroup, const char *host,
4898937Sdes            const char *user, const char *domain);
4998937Sdes#endif /* HAVE_INNETGR */
5098937Sdes
5198937Sdes#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
5298937Sdesint seteuid(uid_t euid);
5398937Sdes#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
5498937Sdes
5598937Sdes#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID)
5698937Sdesint setegid(uid_t egid);
5798937Sdes#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */
5898937Sdes
5998937Sdes#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR)
6098937Sdesconst char *strerror(int e);
6198937Sdes#endif
6298937Sdes
6398937Sdes
6498937Sdes#ifndef HAVE_UTIMES
6598937Sdes#ifndef HAVE_STRUCT_TIMEVAL
6698937Sdesstruct timeval {
6798937Sdes	long tv_sec;
6898937Sdes	long tv_usec;
6998937Sdes}
7098937Sdes#endif /* HAVE_STRUCT_TIMEVAL */
7198937Sdes
7298937Sdesint utimes(char *filename, struct timeval *tvp);
7398937Sdes#endif /* HAVE_UTIMES */
7498937Sdes
7598937Sdes#ifndef HAVE_TRUNCATE
7698937Sdesint truncate (const char *path, off_t length);
7798937Sdes#endif /* HAVE_TRUNCATE */
7898937Sdes
7998937Sdes#if !defined(HAVE_SETGROUPS) && defined(SETGROUPS_NOOP)
8098937Sdesint setgroups(size_t size, const gid_t *list);
8198937Sdes#endif
8298937Sdes
8398937Sdes
8498937Sdes#endif /* _BSD_MISC_H */
85