summaryrefslogtreecommitdiff
path: root/src/port/unistd.h
blob: 6a0bb91d1da3f4d8a53709e3fed05fadd06372b1 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
    Copyright (C) 2008 Andreas Baumann <abaumann@yahoo.com>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef __UNISTD_H
#define __UNISTD_H

#include "port/sys_internal.h"

#include <unistd.h>

#if !defined HAVE_LOCKF || defined TEST_LOCKF

#include <sys/types.h>		/* for off_t */
#include <fcntl.h>		/* for F_XXX constants */

#if !defined F_ULOCK
#define F_ULOCK	0		/* Unlock a previously locked region */
#define F_LOCK	1		/* Lock exclusively */
#define F_TLOCK	2		/* Test and lock exclusively */
#define F_TEST	3		/* Test for a locked region */
#endif

extern int wolf_port_lockf( int fd, int cmd, off_t len );
#if !defined HAVE_LOCKF
#define lockf( fd, cmd, len ) wolf_port_lockf( fd, cmd, len )
#endif

#endif /* !defined HAVE_LOCKF || defined TEST_LOCKF */

#endif /* ifndef __UNISTD_H */