summaryrefslogtreecommitdiff
path: root/libexec/popa3d/misc.h
blob: 17b3e2ebf4cd89f9389858ba032b814961e202f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* $OpenBSD: misc.h,v 1.2 2001/08/13 20:19:33 camield Exp $ */

/*
 * Miscellaneous syscall wrappers.
 */

#ifndef _POP_MISC_H
#define _POP_MISC_H

/*
 * A select(2)-based sleep() equivalent: no more problems with SIGALRM,
 * subsecond precision.
 */
extern int sleep_select(int sec, int usec);

/*
 * Obtain or remove a lock.
 */
extern int lock_fd(int fd, int shared);
extern int unlock_fd(int fd);

/*
 * Attempts to write all the supplied data. Returns the number of bytes
 * written. Any value that differs from the requested count means that
 * an error has occured; if the value is -1, errno is set appropriately.
 */
extern int write_loop(int fd, char *buffer, int count);

#endif