ReactOS
0.4.16-dev-716-g2b2bdab
eaccess.c
Go to the documentation of this file.
1
/* @(#)eaccess.c 1.6 14/05/15 Copyright 2004-2014 J. Schilling */
2
#include <
schily/mconfig.h
>
3
#ifndef lint
4
static
UConst
char
sccsid
[] =
5
"@(#)eaccess.c 1.6 14/05/15 Copyright 2004-2014 J. Schilling"
;
6
#endif
7
/*
8
* Implement the best possible emulation for eaccess()
9
*
10
* Copyright 2004-2014 J. Schilling
11
*/
12
/*
13
* The contents of this file are subject to the terms of the
14
* Common Development and Distribution License, Version 1.0 only
15
* (the "License"). You may not use this file except in compliance
16
* with the License.
17
*
18
* See the file CDDL.Schily.txt in this distribution for details.
19
* A copy of the CDDL is also available via the Internet at
20
* http://www.opensource.org/licenses/cddl1.txt
21
*
22
* When distributing Covered Code, include this CDDL HEADER in each
23
* file and include the License file CDDL.Schily.txt from this distribution.
24
*/
25
26
#include <
schily/unistd.h
>
27
#include <
schily/standard.h
>
28
#include <
schily/errno.h
>
29
#include <
schily/schily.h
>
30
31
#ifndef HAVE_EACCESS
32
EXPORT
int
eaccess
__PR
((
const
char
*
name
,
int
mode
));
33
34
EXPORT
int
35
eaccess
(
name
,
mode
)
36
const
char
*
name
;
37
int
mode
;
38
{
39
#ifdef HAVE_EUIDACCESS
40
return
(euidaccess(
name
,
mode
));
41
#else
42
#ifdef HAVE_ACCESS_E_OK
43
return
(
access
(
name
,
E_OK
|
mode
));
44
#else
45
if
(
getuid
() ==
geteuid
() &&
getgid
() ==
getegid
())
46
return
(
access
(
name
,
mode
));
47
#ifdef EOPNOTSUPP
48
seterrno
(
EOPNOTSUPP
);
49
#else
50
seterrno
(
EINVAL
);
51
#endif
52
return
(-1);
53
#endif
54
#endif
55
}
56
#endif
EINVAL
#define EINVAL
Definition:
acclib.h:90
getuid
uid_t getuid()
Definition:
uid.c:27
UConst
#define UConst
Definition:
ccomdefs.h:72
EOPNOTSUPP
#define EOPNOTSUPP
Definition:
errno.h:104
sccsid
static UConst char sccsid[]
Definition:
eaccess.c:4
eaccess
EXPORT int eaccess(char *name, int mode) const
Definition:
eaccess.c:35
getegid
EXPORT gid_t getegid()
Definition:
gid.c:37
getgid
EXPORT gid_t getgid()
Definition:
gid.c:27
mode
GLenum mode
Definition:
glext.h:6217
access
GLuint GLint GLboolean GLint GLenum access
Definition:
glext.h:7866
mconfig.h
__PR
#define __PR(a)
Definition:
prototyp.h:106
schily.h
errno.h
seterrno
EXPORT int seterrno(int err)
Definition:
seterrno.c:34
standard.h
EXPORT
Definition:
spec2def.c:21
name
Definition:
name.c:39
unistd.h
E_OK
#define E_OK
Definition:
unistd.h:112
geteuid
EXPORT uid_t geteuid()
Definition:
uid.c:37
sdk
tools
mkisofs
schilytools
libschily
eaccess.c
Generated on Thu Feb 6 2025 06:14:54 for ReactOS by
1.9.6