[PATCH] 055 release
[systemd_ALT/systemd_imz.git] / udev_libc_wrapper.h
blob4d6d332c691255e7e1ae001c67d3933f83e47bb7
1 /*
2 * udev_libc_wrapper - wrapping of functions missing in a specific libc
3 * or not working in a statically compiled binary
5 * Copyright (C) 2005 Kay Sievers <kay.sievers@vrfy.org>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation version 2 of the License.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef _UDEV_LIBC_WRAPPER_H_
23 #define _UDEV_LIBC_WRAPPER_H_
25 #undef asmlinkage
26 #ifdef __i386__
27 #define asmlinkage __attribute__((regparm(0)))
28 #else
29 #define asmlinkage
30 #endif
32 #ifndef __FD_SET
33 #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
34 #endif
35 #ifndef __FD_CLR
36 #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
37 #endif
38 #ifndef __FD_ISSET
39 #define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0)
40 #endif
41 #ifndef __FD_ZERO
42 #define __FD_ZERO(set) ((void) memset ((void*) (set), 0, sizeof (fd_set)))
43 #endif
45 #include <string.h>
47 extern uid_t lookup_user(const char *user);
48 extern gid_t lookup_group(const char *group);
50 #ifndef strlcat
51 extern size_t strlcpy(char *dst, const char *src, size_t size);
52 #endif
54 #ifndef strlcat
55 extern size_t strlcat(char *dst, const char *src, size_t size);
56 #endif
58 #endif /* _UDEV_LIBC_WRAPPER_H_ */