xref: /aosp_15_r20/external/ltp/pan/zoolib.h (revision 49cdfc7efb34551c7342be41a7384b9c40d7cab7)
1*49cdfc7eSAndroid Build Coastguard Worker /*
2*49cdfc7eSAndroid Build Coastguard Worker  * Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
3*49cdfc7eSAndroid Build Coastguard Worker  *
4*49cdfc7eSAndroid Build Coastguard Worker  * This program is free software; you can redistribute it and/or modify it
5*49cdfc7eSAndroid Build Coastguard Worker  * under the terms of version 2 of the GNU General Public License as
6*49cdfc7eSAndroid Build Coastguard Worker  * published by the Free Software Foundation.
7*49cdfc7eSAndroid Build Coastguard Worker  *
8*49cdfc7eSAndroid Build Coastguard Worker  * This program is distributed in the hope that it would be useful, but
9*49cdfc7eSAndroid Build Coastguard Worker  * WITHOUT ANY WARRANTY; without even the implied warranty of
10*49cdfc7eSAndroid Build Coastguard Worker  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11*49cdfc7eSAndroid Build Coastguard Worker  *
12*49cdfc7eSAndroid Build Coastguard Worker  * Further, this software is distributed without any warranty that it is
13*49cdfc7eSAndroid Build Coastguard Worker  * free of the rightful claim of any third person regarding infringement
14*49cdfc7eSAndroid Build Coastguard Worker  * or the like.  Any license provided herein, whether implied or
15*49cdfc7eSAndroid Build Coastguard Worker  * otherwise, applies only to this software file.  Patent licenses, if
16*49cdfc7eSAndroid Build Coastguard Worker  * any, provided herein do not apply to combinations of this program with
17*49cdfc7eSAndroid Build Coastguard Worker  * other software, or any other product whatsoever.
18*49cdfc7eSAndroid Build Coastguard Worker  *
19*49cdfc7eSAndroid Build Coastguard Worker  * You should have received a copy of the GNU General Public License along
20*49cdfc7eSAndroid Build Coastguard Worker  * with this program; if not, write the Free Software Foundation, Inc.,
21*49cdfc7eSAndroid Build Coastguard Worker  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22*49cdfc7eSAndroid Build Coastguard Worker  *
23*49cdfc7eSAndroid Build Coastguard Worker  * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24*49cdfc7eSAndroid Build Coastguard Worker  * Mountain View, CA  94043, or:
25*49cdfc7eSAndroid Build Coastguard Worker  *
26*49cdfc7eSAndroid Build Coastguard Worker  * http://www.sgi.com
27*49cdfc7eSAndroid Build Coastguard Worker  *
28*49cdfc7eSAndroid Build Coastguard Worker  * For further information regarding this notice, see:
29*49cdfc7eSAndroid Build Coastguard Worker  *
30*49cdfc7eSAndroid Build Coastguard Worker  * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
31*49cdfc7eSAndroid Build Coastguard Worker  *
32*49cdfc7eSAndroid Build Coastguard Worker  */
33*49cdfc7eSAndroid Build Coastguard Worker /* $Id: zoolib.h,v 1.5 2006/06/27 09:37:34 vapier Exp $ */
34*49cdfc7eSAndroid Build Coastguard Worker #ifndef ZOOLIB_H
35*49cdfc7eSAndroid Build Coastguard Worker #define ZOOLIB_H
36*49cdfc7eSAndroid Build Coastguard Worker 
37*49cdfc7eSAndroid Build Coastguard Worker #include <stdio.h>
38*49cdfc7eSAndroid Build Coastguard Worker #include <sys/types.h>
39*49cdfc7eSAndroid Build Coastguard Worker #include <unistd.h>
40*49cdfc7eSAndroid Build Coastguard Worker #include <errno.h>
41*49cdfc7eSAndroid Build Coastguard Worker #include <fcntl.h>
42*49cdfc7eSAndroid Build Coastguard Worker #include <sys/signal.h>
43*49cdfc7eSAndroid Build Coastguard Worker 
44*49cdfc7eSAndroid Build Coastguard Worker typedef FILE *zoo_t;
45*49cdfc7eSAndroid Build Coastguard Worker #define ZELEN 512
46*49cdfc7eSAndroid Build Coastguard Worker extern char zoo_error[ZELEN];
47*49cdfc7eSAndroid Build Coastguard Worker #define BUFLEN 81
48*49cdfc7eSAndroid Build Coastguard Worker 
49*49cdfc7eSAndroid Build Coastguard Worker int lock_file( FILE *fp, short ltype, char **errmsg );
50*49cdfc7eSAndroid Build Coastguard Worker /* FILE *open_file( char *file, char *mode, char **errmsg ); */
51*49cdfc7eSAndroid Build Coastguard Worker 
52*49cdfc7eSAndroid Build Coastguard Worker void wait_handler();
53*49cdfc7eSAndroid Build Coastguard Worker 
54*49cdfc7eSAndroid Build Coastguard Worker /*  char *zoo_active( void ); */
55*49cdfc7eSAndroid Build Coastguard Worker /* zoo_getname(): create a filename to use for the zoo
56*49cdfc7eSAndroid Build Coastguard Worker  * 	returns NULL on error */
57*49cdfc7eSAndroid Build Coastguard Worker char *zoo_getname(void);
58*49cdfc7eSAndroid Build Coastguard Worker 
59*49cdfc7eSAndroid Build Coastguard Worker /* zoo_open(): open a zoo file for use
60*49cdfc7eSAndroid Build Coastguard Worker  * 	returns NULL on error */
61*49cdfc7eSAndroid Build Coastguard Worker zoo_t zoo_open(char *zooname);
62*49cdfc7eSAndroid Build Coastguard Worker 
63*49cdfc7eSAndroid Build Coastguard Worker /* zoo_close(): close an open zoo file */
64*49cdfc7eSAndroid Build Coastguard Worker int zoo_close(zoo_t z);
65*49cdfc7eSAndroid Build Coastguard Worker 
66*49cdfc7eSAndroid Build Coastguard Worker /* zoo_mark_cmdline(): make an entry to the zoo
67*49cdfc7eSAndroid Build Coastguard Worker  *	returns 0 on success, -1 on error */
68*49cdfc7eSAndroid Build Coastguard Worker int zoo_mark_cmdline(zoo_t z, pid_t p, char *tag, char *cmdline);
69*49cdfc7eSAndroid Build Coastguard Worker 
70*49cdfc7eSAndroid Build Coastguard Worker /* zoo_mark_args(): make an entry to the zoo using argc argv
71*49cdfc7eSAndroid Build Coastguard Worker  *	returns 0 on success, -1 on error */
72*49cdfc7eSAndroid Build Coastguard Worker int zoo_mark_args(zoo_t z, pid_t p, char *tag, int ac, char **av);
73*49cdfc7eSAndroid Build Coastguard Worker 
74*49cdfc7eSAndroid Build Coastguard Worker /* zoo_clear(): mark a pid as completed
75*49cdfc7eSAndroid Build Coastguard Worker  *	returns 0 on success, -1 on error, 1 as warning */
76*49cdfc7eSAndroid Build Coastguard Worker int zoo_clear(zoo_t z, pid_t p);
77*49cdfc7eSAndroid Build Coastguard Worker 
78*49cdfc7eSAndroid Build Coastguard Worker /* zoo_getpid(): get the pid for a specified tag
79*49cdfc7eSAndroid Build Coastguard Worker  * 	returns pid_t on success and 0 on error */
80*49cdfc7eSAndroid Build Coastguard Worker pid_t zoo_getpid(zoo_t z, char *tag);
81*49cdfc7eSAndroid Build Coastguard Worker 
82*49cdfc7eSAndroid Build Coastguard Worker 
83*49cdfc7eSAndroid Build Coastguard Worker #endif /* ZOOLIB_H */
84