blob: 7c88d1ba68c844f8cfa470af5b26e9e1195c69a6 [file] [log] [blame]
Bernhard Reutner-Fischerb1629b12006-05-19 19:29:19 +00001/* vi: set sw=4 ts=4: */
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +00002/*
Bernhard Reutner-Fischer6c4dade2008-09-25 12:13:34 +00003 Copyright 2006, Bernhard Reutner-Fischer
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +00004
5 Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
6*/
Denis Vlasenkof81e8db2009-04-09 12:35:13 +00007#ifndef BB_PLATFORM_H
8#define BB_PLATFORM_H 1
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +00009
10/* Convenience macros to test the version of gcc. */
11#undef __GNUC_PREREQ
12#if defined __GNUC__ && defined __GNUC_MINOR__
13# define __GNUC_PREREQ(maj, min) \
Denis Vlasenko9213a9e2006-09-17 16:28:10 +000014 ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000015#else
16# define __GNUC_PREREQ(maj, min) 0
17#endif
18
19/* __restrict is known in EGCS 1.2 and above. */
Denis Vlasenko98636eb2008-05-09 17:59:34 +000020#if !__GNUC_PREREQ(2,92)
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000021# ifndef __restrict
Denys Vlasenko5a49d282009-05-19 13:18:45 +020022# define __restrict
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000023# endif
24#endif
25
26/* Define macros for some gcc attributes. This permits us to use the
27 macros freely, and know that they will come into play for the
28 version of gcc in which they are supported. */
29
Denis Vlasenko98636eb2008-05-09 17:59:34 +000030#if !__GNUC_PREREQ(2,7)
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000031# ifndef __attribute__
32# define __attribute__(x)
33# endif
34#endif
35
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +000036#undef inline
Denis Vlasenkoa7189f02006-11-17 20:29:00 +000037#if defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +000038/* it's a keyword */
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +020039#elif __GNUC_PREREQ(2,7)
40# define inline __inline__
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +000041#else
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +020042# define inline
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +000043#endif
44
45#ifndef __const
46# define __const const
47#endif
48
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000049#define UNUSED_PARAM __attribute__ ((__unused__))
50#define NORETURN __attribute__ ((__noreturn__))
51#define PACKED __attribute__ ((__packed__))
52#define ALIGNED(m) __attribute__ ((__aligned__(m)))
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +020053
Denis Vlasenko0f3a5802008-03-20 13:13:09 +000054/* __NO_INLINE__: some gcc's do not honor inlining! :( */
Denis Vlasenko98636eb2008-05-09 17:59:34 +000055#if __GNUC_PREREQ(3,0) && !defined(__NO_INLINE__)
56# define ALWAYS_INLINE __attribute__ ((always_inline)) inline
Denis Vlasenko77f1ec12007-10-13 03:36:03 +000057/* I've seen a toolchain where I needed __noinline__ instead of noinline */
Denis Vlasenko98636eb2008-05-09 17:59:34 +000058# define NOINLINE __attribute__((__noinline__))
59# if !ENABLE_WERROR
Denis Vlasenkoa60f84e2008-07-05 09:18:54 +000060# define DEPRECATED __attribute__ ((__deprecated__))
61# define UNUSED_PARAM_RESULT __attribute__ ((warn_unused_result))
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +000062# else
Denys Vlasenko5a49d282009-05-19 13:18:45 +020063# define DEPRECATED
64# define UNUSED_PARAM_RESULT
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +000065# endif
Denis Vlasenko98636eb2008-05-09 17:59:34 +000066#else
Denys Vlasenko5a49d282009-05-19 13:18:45 +020067# define ALWAYS_INLINE inline
68# define NOINLINE
69# define DEPRECATED
70# define UNUSED_PARAM_RESULT
Denis Vlasenko98636eb2008-05-09 17:59:34 +000071#endif
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +000072
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000073/* -fwhole-program makes all symbols local. The attribute externally_visible
74 forces a symbol global. */
Denis Vlasenko98636eb2008-05-09 17:59:34 +000075#if __GNUC_PREREQ(4,1)
76# define EXTERNALLY_VISIBLE __attribute__(( visibility("default") ))
Denis Vlasenko9b49a5e2007-10-11 10:05:36 +000077//__attribute__ ((__externally_visible__))
Denis Vlasenko98636eb2008-05-09 17:59:34 +000078#else
79# define EXTERNALLY_VISIBLE
Denis Vlasenko6ebb2f52008-12-03 10:46:12 +000080#endif
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000081
82/* We use __extension__ in some places to suppress -pedantic warnings
83 about GCC extensions. This feature didn't work properly before
84 gcc 2.8. */
Denis Vlasenko98636eb2008-05-09 17:59:34 +000085#if !__GNUC_PREREQ(2,8)
Bernhard Reutner-Fischer86f5c992006-01-22 22:55:11 +000086# ifndef __extension__
87# define __extension__
88# endif
89#endif
90
Bernhard Reutner-Fischerb5f50ea2006-09-12 13:27:55 +000091/* gcc-2.95 had no va_copy but only __va_copy. */
Denis Vlasenko98636eb2008-05-09 17:59:34 +000092#if !__GNUC_PREREQ(3,0)
Bernhard Reutner-Fischerb5f50ea2006-09-12 13:27:55 +000093# include <stdarg.h>
94# if !defined va_copy && defined __va_copy
95# define va_copy(d,s) __va_copy((d),(s))
96# endif
97#endif
98
Denis Vlasenko42b8daf2008-06-27 03:55:18 +000099/* FAST_FUNC is a qualifier which (possibly) makes function call faster
100 * and/or smaller by using modified ABI. It is usually only needed
101 * on non-static, busybox internal functions. Recent versions of gcc
102 * optimize statics automatically. FAST_FUNC on static is required
103 * only if you need to match a function pointer's type */
Denis Vlasenkoac2b50e2008-06-27 04:30:48 +0000104#if __GNUC_PREREQ(3,0) && defined(i386) /* || defined(__x86_64__)? */
105/* stdcall makes callee to pop arguments from stack, not caller */
106# define FAST_FUNC __attribute__((regparm(3),stdcall))
Denis Vlasenko42b8daf2008-06-27 03:55:18 +0000107/* #elif ... - add your favorite arch today! */
Denis Vlasenkodefc1ea2008-06-27 02:52:20 +0000108#else
109# define FAST_FUNC
110#endif
111
Denis Vlasenkof81e8db2009-04-09 12:35:13 +0000112/* Make all declarations hidden (-fvisibility flag only affects definitions) */
113/* (don't include system headers after this until corresponding pop!) */
114#if __GNUC_PREREQ(4,1)
115# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN _Pragma("GCC visibility push(hidden)")
116# define POP_SAVED_FUNCTION_VISIBILITY _Pragma("GCC visibility pop")
117#else
118# define PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
119# define POP_SAVED_FUNCTION_VISIBILITY
120#endif
121
Rob Landley5cf7c2d2006-02-21 06:44:43 +0000122/* ---- Endian Detection ------------------------------------ */
Rob Landley5cf7c2d2006-02-21 06:44:43 +0000123
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200124#if defined(__digital__) && defined(__unix__)
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000125# include <sex.h>
126# define __BIG_ENDIAN__ (BYTE_ORDER == BIG_ENDIAN)
127# define __BYTE_ORDER BYTE_ORDER
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200128#elif defined __FreeBSD__
129char *strchrnul(const char *s, int c);
130# include <sys/resource.h> /* rlimit */
131# include <machine/endian.h>
132# define bswap_64 __bswap64
133# define bswap_32 __bswap32
134# define bswap_16 __bswap16
135# define __BIG_ENDIAN__ (_BYTE_ORDER == _BIG_ENDIAN)
Rob Landley15d20a02006-05-29 05:00:44 +0000136#elif !defined __APPLE__
137# include <byteswap.h>
138# include <endian.h>
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000139#endif
140
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200141#if defined(__BIG_ENDIAN__) && __BIG_ENDIAN__
Mike Frysingerf8855132006-03-28 02:35:56 +0000142# define BB_BIG_ENDIAN 1
143# define BB_LITTLE_ENDIAN 0
Rob Landley5cf7c2d2006-02-21 06:44:43 +0000144#elif __BYTE_ORDER == __BIG_ENDIAN
Mike Frysingerf8855132006-03-28 02:35:56 +0000145# define BB_BIG_ENDIAN 1
146# define BB_LITTLE_ENDIAN 0
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200147#elif __BYTE_ORDER == __LITTLE_ENDIAN
Mike Frysingerf8855132006-03-28 02:35:56 +0000148# define BB_BIG_ENDIAN 0
149# define BB_LITTLE_ENDIAN 1
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200150#else
151# error "Can't determine endiannes"
Rob Landley5cf7c2d2006-02-21 06:44:43 +0000152#endif
153
Denis Vlasenko9b0f6e12008-11-01 13:40:32 +0000154/* SWAP_LEnn means "convert CPU<->little_endian by swapping bytes" */
Rob Landleybba7f082006-05-29 05:51:12 +0000155#if BB_BIG_ENDIAN
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200156# define SWAP_BE16(x) (x)
157# define SWAP_BE32(x) (x)
158# define SWAP_BE64(x) (x)
159# define SWAP_LE16(x) bswap_16(x)
160# define SWAP_LE32(x) bswap_32(x)
161# define SWAP_LE64(x) bswap_64(x)
Rob Landleybba7f082006-05-29 05:51:12 +0000162#else
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200163# define SWAP_BE16(x) bswap_16(x)
164# define SWAP_BE32(x) bswap_32(x)
165# define SWAP_BE64(x) bswap_64(x)
166# define SWAP_LE16(x) (x)
167# define SWAP_LE32(x) (x)
168# define SWAP_LE64(x) (x)
Rob Landleybba7f082006-05-29 05:51:12 +0000169#endif
170
Denis Vlasenkofc9e1082008-05-26 17:32:35 +0000171/* ---- Unaligned access ------------------------------------ */
172
Denis Vlasenkoefb545b2008-12-08 22:56:18 +0000173/* NB: unaligned parameter should be a pointer, aligned one -
174 * a lvalue. This makes it more likely to not swap them by mistake
175 */
Denis Vlasenko42b8daf2008-06-27 03:55:18 +0000176#if defined(i386) || defined(__x86_64__)
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200177# define move_from_unaligned16(v, u16p) ((v) = *(uint16_t*)(u16p))
178# define move_from_unaligned32(v, u32p) ((v) = *(uint32_t*)(u32p))
179# define move_to_unaligned32(u32p, v) (*(uint32_t*)(u32p) = (v))
Denis Vlasenko42b8daf2008-06-27 03:55:18 +0000180/* #elif ... - add your favorite arch today! */
Denis Vlasenkofc9e1082008-05-26 17:32:35 +0000181#else
182/* performs reasonably well (gcc usually inlines memcpy here) */
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200183# define move_from_unaligned16(v, u16p) (memcpy(&(v), (u16p), 2))
184# define move_from_unaligned32(v, u32p) (memcpy(&(v), (u32p), 4))
185# define move_to_unaligned32(u32p, v) do { \
Denis Vlasenko3be23082009-04-17 22:20:44 +0000186 uint32_t __t = (v); \
187 memcpy((u32p), &__t, 4); \
188} while (0)
Denis Vlasenkofc9e1082008-05-26 17:32:35 +0000189#endif
190
Rob Landleydae6aa22006-03-09 22:39:08 +0000191/* ---- Networking ------------------------------------------ */
Denis Vlasenkofc9e1082008-05-26 17:32:35 +0000192
Rob Landleydae6aa22006-03-09 22:39:08 +0000193#ifndef __APPLE__
Mike Frysingerf8855132006-03-28 02:35:56 +0000194# include <arpa/inet.h>
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200195# if !defined(__socklen_t_defined) && !defined(_SOCKLEN_T_DECLARED)
Mike Frysinger9412ec72008-02-07 22:41:33 +0000196typedef int socklen_t;
197# endif
Rob Landleydae6aa22006-03-09 22:39:08 +0000198#else
Mike Frysingerf8855132006-03-28 02:35:56 +0000199# include <netinet/in.h>
Rob Landleydae6aa22006-03-09 22:39:08 +0000200#endif
201
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000202/* ---- Compiler dependent settings ------------------------- */
Denis Vlasenkofc9e1082008-05-26 17:32:35 +0000203
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200204#if (defined __digital__ && defined __unix__) \
205 || defined __APPLE__ || defined __FreeBSD__
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000206# undef HAVE_MNTENT_H
Mike Frysinger9412ec72008-02-07 22:41:33 +0000207# undef HAVE_SYS_STATFS_H
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000208#else
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000209# define HAVE_MNTENT_H 1
Mike Frysinger9412ec72008-02-07 22:41:33 +0000210# define HAVE_SYS_STATFS_H 1
Bernhard Reutner-Fischer8c69afd2008-01-29 10:33:34 +0000211#endif
Bernhard Reutner-Fischerbe862092007-03-19 15:15:06 +0000212
Bernhard Reutner-Fischere2e56c72006-05-19 11:54:02 +0000213/*----- Kernel versioning ------------------------------------*/
Denis Vlasenkofc9e1082008-05-26 17:32:35 +0000214
Bernhard Reutner-Fischere2e56c72006-05-19 11:54:02 +0000215#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
Bernhard Reutner-Fischere2e56c72006-05-19 11:54:02 +0000216
Denis Vlasenkofc9e1082008-05-26 17:32:35 +0000217/* ---- Miscellaneous --------------------------------------- */
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000218
Mike Frysingerb16b5bb2006-06-06 06:00:20 +0000219#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ < 5 && \
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000220 !defined(__dietlibc__) && \
221 !defined(_NEWLIB_VERSION) && \
222 !(defined __digital__ && defined __unix__)
Mike Frysingerb16b5bb2006-06-06 06:00:20 +0000223# error "Sorry, this libc version is not supported :("
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000224#endif
225
Denis Vlasenko6ca409e2007-08-12 20:58:27 +0000226/* Don't perpetuate e2fsck crap into the headers. Clean up e2fsck instead. */
Rob Landley18958e92006-06-13 18:28:33 +0000227
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000228#if defined __GLIBC__ || defined __UCLIBC__ \
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200229 || defined __dietlibc__ || defined _NEWLIB_VERSION
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200230# include <features.h>
231# define HAVE_FEATURES_H
232# include <stdint.h>
233# define HAVE_STDINT_H
Mike Frysinger9412ec72008-02-07 22:41:33 +0000234#elif !defined __APPLE__
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200235/* Largest integral types. */
236# if BB_BIG_ENDIAN
237/* Looks BROKEN! */
Denis Vlasenko87468852007-04-13 23:22:00 +0000238typedef long intmax_t;
239typedef unsigned long uintmax_t;
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200240# else
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000241__extension__
Denis Vlasenko87468852007-04-13 23:22:00 +0000242typedef long long intmax_t;
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000243__extension__
Denis Vlasenko87468852007-04-13 23:22:00 +0000244typedef unsigned long long uintmax_t;
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200245# endif
Bernhard Reutner-Fischere00fc162006-05-26 13:10:10 +0000246#endif
247
Bernhard Reutner-Fischerc966ba42007-01-18 10:32:09 +0000248/* Size-saving "small" ints (arch-dependent) */
249#if defined(i386) || defined(__x86_64__) || defined(__mips__) || defined(__cris__)
250/* add other arches which benefit from this... */
251typedef signed char smallint;
252typedef unsigned char smalluint;
253#else
254/* for arches where byte accesses generate larger code: */
255typedef int smallint;
256typedef unsigned smalluint;
257#endif
258
Bernhard Reutner-Fischera8e2e182007-01-20 21:27:18 +0000259/* ISO C Standard: 7.16 Boolean type and values <stdbool.h> */
260#if (defined __digital__ && defined __unix__)
261/* old system without (proper) C99 support */
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200262# define bool smalluint
Bernhard Reutner-Fischera8e2e182007-01-20 21:27:18 +0000263#else
264/* modern system, so use it */
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200265# include <stdbool.h>
Bernhard Reutner-Fischera8e2e182007-01-20 21:27:18 +0000266#endif
267
Denis Vlasenko6ca409e2007-08-12 20:58:27 +0000268/* Try to defeat gcc's alignment of "char message[]"-like data */
269#if 1 /* if needed: !defined(arch1) && !defined(arch2) */
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200270# define ALIGN1 __attribute__((aligned(1)))
271# define ALIGN2 __attribute__((aligned(2)))
Denis Vlasenko6ca409e2007-08-12 20:58:27 +0000272#else
273/* Arches which MUST have 2 or 4 byte alignment for everything are here */
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200274# define ALIGN1
275# define ALIGN2
Denis Vlasenko6ca409e2007-08-12 20:58:27 +0000276#endif
277
Bernhard Reutner-Fischera8e2e182007-01-20 21:27:18 +0000278
Mike Frysinger88407592006-07-20 19:31:07 +0000279/* uclibc does not implement daemon() for no-mmu systems.
Bernhard Reutner-Fischer507cd752006-05-31 10:04:03 +0000280 * For 0.9.29 and svn, __ARCH_USE_MMU__ indicates no-mmu reliably.
281 * For earlier versions there is no reliable way to check if we are building
Denis Vlasenko9e589212008-01-24 01:33:42 +0000282 * for a mmu-less system.
Bernhard Reutner-Fischer507cd752006-05-31 10:04:03 +0000283 */
Denis Vlasenkod2c450c2008-01-08 20:32:12 +0000284#if ENABLE_NOMMU || \
285 (defined __UCLIBC__ && __UCLIBC_MAJOR__ >= 0 && __UCLIBC_MINOR__ >= 9 && \
286 __UCLIBC_SUBLEVEL__ > 28 && !defined __ARCH_USE_MMU__)
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200287# define BB_MMU 0
288# define USE_FOR_NOMMU(...) __VA_ARGS__
289# define USE_FOR_MMU(...)
Denis Vlasenko473dae02007-04-11 07:04:23 +0000290#else
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200291# define BB_MMU 1
292# define USE_FOR_NOMMU(...)
293# define USE_FOR_MMU(...) __VA_ARGS__
Bernhard Reutner-Fischer507cd752006-05-31 10:04:03 +0000294#endif
295
Rob Landley18958e92006-06-13 18:28:33 +0000296/* Platforms that haven't got dprintf need to implement fdprintf() in
297 * libbb. This would require a platform.c. It's not going to be cleaned
298 * out of the tree, so stop saying it should be. */
Denis Vlasenko7cfecc42006-12-18 22:32:45 +0000299#if !defined(__dietlibc__)
300/* Needed for: glibc */
301/* Not needed for: dietlibc */
302/* Others: ?? (add as needed) */
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200303# define fdprintf dprintf
Denis Vlasenko7cfecc42006-12-18 22:32:45 +0000304#endif
305
306#if defined(__dietlibc__)
Denis Vlasenko3ad5d0c2007-06-12 20:54:54 +0000307static ALWAYS_INLINE char* strchrnul(const char *s, char c)
Denis Vlasenkoac678ec2007-04-16 22:32:04 +0000308{
Denis Vlasenko7cfecc42006-12-18 22:32:45 +0000309 while (*s && *s != c) ++s;
310 return (char*)s;
311}
Denis Vlasenkoc8e6e352006-12-18 22:10:24 +0000312#endif
Rob Landleyc020f5f2006-05-21 18:28:13 +0000313
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200314/* Don't use lchown with glibc older than 2.1.x */
315#if defined(__GLIBC__) && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1
Mike Frysinger88407592006-07-20 19:31:07 +0000316# define lchown chown
317#endif
318
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200319#if defined(__digital__) && defined(__unix__)
Rob Landley8fba99f2006-05-27 22:08:01 +0000320
Denis Vlasenko6ebb2f52008-12-03 10:46:12 +0000321# include <standards.h>
Denis Vlasenko6ebb2f52008-12-03 10:46:12 +0000322# include <inttypes.h>
Denis Vlasenko6ebb2f52008-12-03 10:46:12 +0000323# define PRIu32 "u"
Denis Vlasenko0de3c552007-04-12 12:31:02 +0000324/* use legacy setpgrp(pid_t,pid_t) for now. move to platform.c */
Denis Vlasenko6ebb2f52008-12-03 10:46:12 +0000325# define bb_setpgrp() do { pid_t __me = getpid(); setpgrp(__me,__me); } while (0)
Denis Vlasenko6ebb2f52008-12-03 10:46:12 +0000326# if !defined ADJ_OFFSET_SINGLESHOT && defined MOD_CLKA && defined MOD_OFFSET
327# define ADJ_OFFSET_SINGLESHOT (MOD_CLKA | MOD_OFFSET)
328# endif
329# if !defined ADJ_FREQUENCY && defined MOD_FREQUENCY
330# define ADJ_FREQUENCY MOD_FREQUENCY
331# endif
332# if !defined ADJ_TIMECONST && defined MOD_TIMECONST
333# define ADJ_TIMECONST MOD_TIMECONST
334# endif
335# if !defined ADJ_TICK && defined MOD_CLKB
336# define ADJ_TICK MOD_CLKB
337# endif
Rob Landley8fba99f2006-05-27 22:08:01 +0000338
Denys Vlasenko9b1b62a2009-07-05 03:34:12 +0200339#else
Denis Vlasenko6ebb2f52008-12-03 10:46:12 +0000340
341# define bb_setpgrp() setpgrp()
342
Rob Landley18958e92006-06-13 18:28:33 +0000343#endif
344
Denys Vlasenko5a49d282009-05-19 13:18:45 +0200345
Denis Vlasenkof81e8db2009-04-09 12:35:13 +0000346#endif