mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-12-13 16:29:23 +00:00
prototyped
This commit is contained in:
parent
51ae0e883d
commit
b5b9abc713
@ -34,6 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef __GNO__
|
||||
#ifndef lint
|
||||
static char copyright[] =
|
||||
"@(#) Copyright (c) 1991, 1993\n\
|
||||
@ -43,6 +44,7 @@ static char copyright[] =
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 7/15/93";
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
@ -169,9 +171,7 @@ DB *session_db;
|
||||
* The mother of all processes.
|
||||
*/
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int c;
|
||||
struct sigaction sa;
|
||||
@ -266,6 +266,12 @@ main(argc, argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#ifdef __ORCAC__
|
||||
/* we need this for variadic functions */
|
||||
#pragma optimize 72
|
||||
#pragma debug 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Associate a function with a signal handler.
|
||||
*/
|
||||
@ -410,6 +416,10 @@ emergency(va_alist)
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
#ifdef __ORCAC__
|
||||
/* end of variadic functions */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Catch a SIGSYS signal.
|
||||
*
|
||||
@ -417,8 +427,7 @@ emergency(va_alist)
|
||||
* We tolerate up to 25 of these, then throw in the towel.
|
||||
*/
|
||||
void
|
||||
badsys(sig)
|
||||
int sig;
|
||||
badsys(int sig)
|
||||
{
|
||||
static int badcount = 0;
|
||||
|
||||
@ -431,8 +440,7 @@ badsys(sig)
|
||||
* Catch an unexpected signal.
|
||||
*/
|
||||
void
|
||||
disaster(sig)
|
||||
int sig;
|
||||
disaster(int sig)
|
||||
{
|
||||
emergency("fatal signal: %s",
|
||||
sig < (unsigned) NSIG ? sys_siglist[sig] : "unknown signal");
|
||||
@ -500,8 +508,7 @@ setsecuritylevel(newlevel)
|
||||
* The initial state is passed as an argument.
|
||||
*/
|
||||
void
|
||||
transition(s)
|
||||
state_t s;
|
||||
transition(state_t s)
|
||||
{
|
||||
for (;;)
|
||||
s = (state_t) (*s)();
|
||||
@ -512,8 +519,7 @@ transition(s)
|
||||
* NB: should send a message to the session logger to avoid blocking.
|
||||
*/
|
||||
void
|
||||
clear_session_logs(sp)
|
||||
session_t *sp;
|
||||
clear_session_logs(session_t *sp)
|
||||
{
|
||||
char *line = sp->se_device + sizeof(_PATH_DEV) - 1;
|
||||
|
||||
@ -526,8 +532,7 @@ clear_session_logs(sp)
|
||||
* Only called by children of init after forking.
|
||||
*/
|
||||
void
|
||||
setctty(name)
|
||||
char *name;
|
||||
setctty(char *name)
|
||||
{
|
||||
int fd;
|
||||
|
||||
@ -546,7 +551,7 @@ setctty(name)
|
||||
* Bring the system up single user.
|
||||
*/
|
||||
state_func_t
|
||||
single_user()
|
||||
single_user(void)
|
||||
{
|
||||
pid_t pid, wpid;
|
||||
int status;
|
||||
@ -699,7 +704,7 @@ single_user()
|
||||
* Run the system startup script.
|
||||
*/
|
||||
state_func_t
|
||||
runcom()
|
||||
runcom(void)
|
||||
{
|
||||
pid_t pid, wpid;
|
||||
int status;
|
||||
@ -788,7 +793,7 @@ runcom()
|
||||
* NB: We could pass in the size here; is it necessary?
|
||||
*/
|
||||
int
|
||||
start_session_db()
|
||||
start_session_db(void)
|
||||
{
|
||||
if (session_db && (*session_db->close)(session_db))
|
||||
emergency("session database close: %s", strerror(errno));
|
||||
@ -804,8 +809,7 @@ start_session_db()
|
||||
* Add a new login session.
|
||||
*/
|
||||
void
|
||||
add_session(sp)
|
||||
session_t *sp;
|
||||
add_session(session_t *sp)
|
||||
{
|
||||
DBT key;
|
||||
DBT data;
|
||||
@ -823,8 +827,7 @@ add_session(sp)
|
||||
* Delete an old login session.
|
||||
*/
|
||||
void
|
||||
del_session(sp)
|
||||
session_t *sp;
|
||||
del_session(session_t *sp)
|
||||
{
|
||||
DBT key;
|
||||
|
||||
@ -862,8 +865,7 @@ find_session(pid)
|
||||
* Construct an argument vector from a command line.
|
||||
*/
|
||||
char **
|
||||
construct_argv(command)
|
||||
char *command;
|
||||
construct_argv(char *command)
|
||||
{
|
||||
char *strk (char *);
|
||||
register int argc = 0;
|
||||
@ -881,8 +883,7 @@ construct_argv(command)
|
||||
* Deallocate a session descriptor.
|
||||
*/
|
||||
void
|
||||
free_session(sp)
|
||||
register session_t *sp;
|
||||
free_session(register session_t *sp)
|
||||
{
|
||||
free(sp->se_device);
|
||||
if (sp->se_getty) {
|
||||
@ -904,10 +905,7 @@ free_session(sp)
|
||||
* Allocate a new session descriptor.
|
||||
*/
|
||||
session_t *
|
||||
new_session(sprev, session_index, typ)
|
||||
session_t *sprev;
|
||||
int session_index;
|
||||
register struct ttyent *typ;
|
||||
new_session(session_t *sprev, int session_index, register struct ttyent *typ)
|
||||
{
|
||||
register session_t *sp;
|
||||
|
||||
@ -945,9 +943,7 @@ new_session(sprev, session_index, typ)
|
||||
* Calculate getty and if useful window argv vectors.
|
||||
*/
|
||||
int
|
||||
setupargv(sp, typ)
|
||||
session_t *sp;
|
||||
struct ttyent *typ;
|
||||
setupargv(session_t *sp, struct ttyent *typ)
|
||||
{
|
||||
|
||||
if (sp->se_getty) {
|
||||
@ -996,7 +992,7 @@ setupargv(sp, typ)
|
||||
* Walk the list of ttys and create sessions for each active line.
|
||||
*/
|
||||
state_func_t
|
||||
read_ttys()
|
||||
read_ttys(void)
|
||||
{
|
||||
int session_index = 0;
|
||||
register session_t *sp, *snext;
|
||||
@ -1033,8 +1029,7 @@ read_ttys()
|
||||
* Start a window system running.
|
||||
*/
|
||||
void
|
||||
start_window_system(sp)
|
||||
session_t *sp;
|
||||
start_window_system(session_t *sp)
|
||||
{
|
||||
pid_t pid;
|
||||
sigset_t mask;
|
||||
@ -1075,8 +1070,7 @@ start_window_system(sp)
|
||||
* Start a login session running.
|
||||
*/
|
||||
pid_t
|
||||
start_getty(sp)
|
||||
session_t *sp;
|
||||
start_getty(session_t *sp)
|
||||
{
|
||||
pid_t pid;
|
||||
sigset_t mask;
|
||||
@ -1183,8 +1177,7 @@ collect_child(pid)
|
||||
* Catch a signal and request a state transition.
|
||||
*/
|
||||
void
|
||||
transition_handler(sig)
|
||||
int sig;
|
||||
transition_handler(int sig)
|
||||
{
|
||||
|
||||
switch (sig) {
|
||||
@ -1209,7 +1202,7 @@ transition_handler(sig)
|
||||
* Take the system multiuser.
|
||||
*/
|
||||
state_func_t
|
||||
multi_user()
|
||||
multi_user(void)
|
||||
{
|
||||
pid_t pid;
|
||||
register session_t *sp;
|
||||
@ -1249,7 +1242,7 @@ multi_user()
|
||||
* This is an n-squared algorithm. We hope it isn't run often...
|
||||
*/
|
||||
state_func_t
|
||||
clean_ttys()
|
||||
clean_ttys(void)
|
||||
{
|
||||
register session_t *sp, *sprev;
|
||||
register struct ttyent *typ;
|
||||
@ -1326,7 +1319,7 @@ clean_ttys()
|
||||
* Block further logins.
|
||||
*/
|
||||
state_func_t
|
||||
catatonia()
|
||||
catatonia(void)
|
||||
{
|
||||
register session_t *sp;
|
||||
|
||||
@ -1340,8 +1333,7 @@ catatonia()
|
||||
* Note SIGALRM.
|
||||
*/
|
||||
void
|
||||
alrm_handler(sig)
|
||||
int sig;
|
||||
alrm_handler(int sig)
|
||||
{
|
||||
clang = 1;
|
||||
}
|
||||
@ -1350,7 +1342,7 @@ alrm_handler(sig)
|
||||
* Bring the system down to single user.
|
||||
*/
|
||||
state_func_t
|
||||
death()
|
||||
death(void)
|
||||
{
|
||||
register session_t *sp;
|
||||
register int i;
|
||||
@ -1382,6 +1374,7 @@ death()
|
||||
|
||||
return (state_func_t) single_user;
|
||||
}
|
||||
|
||||
char *
|
||||
strk (char *p)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user