OSDN Git Service

* fhandler.cc (fhandler_base::dup): Drop setting flags in the parent.
[pf3gnuchains/pf3gnuchains4x.git] / winsup / cygwin / include / cygwin / version.h
1 /* version.h -- Cygwin version numbers and accompanying documentation.
2
3    Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4    2005, 2006, 2007 Red Hat, Inc.
5
6 This file is part of Cygwin.
7
8 This software is a copyrighted work licensed under the terms of the
9 Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
10 details. */
11
12 /* Cygwin versioning is relatively complicated because of its status
13    as a shared library.  Let's start with how versioning used to be done.
14
15    Historical versioning in Cygwin 16.0 to 19.5:
16
17    In the olden days of Cygwin, we had a dll major and minor version
18    and a registry version.  The major number started at 16 because the
19    "b15" GNU-Win32 release of the compiler tools was out when this
20    scheme was started.  We incremented the DLL name frequently (for
21    every official release) and towards the end of this period every
22    release used a different shared memory area to prevent DLLs from
23    interfering with each other (embedding a build timestamp into the
24    name of the shared memory area).  This turned out to be a Bad Idea
25    (tm) because people needed to mingle separate releases and have
26    them work together more than we thought they would.  This was
27    especially problematic when tty info needed to be retained when an
28    old Cygwin executable executed a newer one.
29
30    In the old scheme, we incremented the major number whenever a
31    change to the dll invalidated existing executables.  This can
32    happen for a number of reasons, including when functions are
33    removed from the export list of the dll.  The minor number was
34    incremented when a change was made that we wanted to record, but
35    that didn't invalidate existing executables.  Both numbers were
36    recorded in the executable and in the dll.
37
38    In October 1998 (starting with Cygwin 19.6), we started a new method
39    of Cygwin versioning: */
40
41       /* The DLL major and minor numbers correspond to the "version of
42          the Cygwin shared library".  This version is used to track important
43          changes to the DLL and is mainly informative in nature. */
44
45 #define CYGWIN_VERSION_DLL_MAJOR 1007
46 #define CYGWIN_VERSION_DLL_MINOR 0
47
48       /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are
49          incompatible. */
50
51 #define CYGWIN_VERSION_DLL_EPOCH 19
52
53       /* CYGWIN_VERSION_DLL_COMBINED gives us a single number
54          representing the combined DLL major and minor numbers. */
55
56       /* WATCH OUT FOR OCTAL!  Don't use, say, "00020" for 0.20 */
57
58 #define CYGWIN_VERSION_DLL_MAKE_COMBINED(maj, min) (((maj) * 1000) + min)
59 #define CYGWIN_VERSION_DLL_COMBINED \
60   CYGWIN_VERSION_DLL_MAKE_COMBINED (CYGWIN_VERSION_DLL_MAJOR, CYGWIN_VERSION_DLL_MINOR)
61
62      /* Every version of cygwin <= this uses an old, incorrect method
63         to determine signal masks. */
64
65 #define CYGWIN_VERSION_USER_API_VERSION_COMBINED \
66   CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor)
67
68     /* API versions <= this had a termios structure whose members were
69        too small to accomodate modern settings. */
70 #define CYGWIN_VERSION_DLL_OLD_TERMIOS          5
71 #define CYGWIN_VERSION_DLL_IS_OLD_TERMIOS \
72   (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= CYGWIN_VERSION_DLL_OLD_TERMIOS)
73
74 #define CYGWIN_VERSION_DLL_MALLOC_ENV           28
75      /* Old APIs had getc/putc macros that conflict with new CR/LF
76         handling in the stdio buffers */
77 #define CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING \
78   (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 20)
79
80 #define CYGWIN_VERSION_CHECK_FOR_S_IEXEC \
81   (CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 36)
82
83 #define CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK \
84   (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 28)
85
86 #define CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES \
87   (CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 79)
88
89 #define CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR \
90   (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 138)
91
92 #define CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES \
93   (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 138)
94
95 #define CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ \
96   (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 161)
97
98      /* API_MAJOR 0.0: Initial version.  API_MINOR changes:
99         1: Export cygwin32_ calls as cygwin_ as well.
100         2: Export j1, jn, y1, yn.
101         3: Export dll_noncygwin_dllcrt0.
102         4: New socket ioctls, revamped ifconf support.
103         5: Thread support/exports.
104         6: Change in termios handling.
105         7: Export scandir and alphasort.
106         8: Export _ctype_, _sys_errlist, _sys_nerr.
107         9: Mount-related changes, new cygwin_umount export.
108            Raw device support (tape, floppies).
109        10: Fast math routine support added.
110        11: Export seekdir, telldir.
111        12: Export pthread_join, pthread_detach.
112        13: Export math funcs gamma and friends, also _j0, _j1, etc.
113        14: Export snprintf and vnsprintf.
114        15: Export glob
115        16: Export cygwin_stackdump
116        17: Export fast math stuff
117        18: Stop exporting _strace_wm
118        19: Export fchown, lchown, lacl
119        20: regsub, inet_network
120        21: incompatible change to stdio cr/lf and buffering
121        22: Export cygwin_logon_user, cygwin_set_impersonation_token.
122            geteuid, getegid return effective uid/gid.
123            getuid, getgid return real uid/gid.
124            seteuid, setegid set only effective uid/gid.
125            setuid, setgid set effective and real uid/gid.
126        23: Export new dll_crt0 interface and cygwin_user_data for use
127            with crt0 startup code.
128        24: Export poll and _poll.
129        25: Export getmode and _getmode.
130        26: CW_GET_CYGDRIVE_PREFIXES addition to external.cc
131        27: CW_GETPINFO_FULL addition to external.cc
132        28: Accidentally bumped by cgf
133        29: Export hstrerror
134        30: CW_GET_CYGDRIVE_INFO addition to external.cc
135        31: Export inet_aton
136        32: Export getrlimit/setrlimit
137        33: Export setlogmask
138        34: Separated out mount table
139        35: Export drand48, erand48, jrand48, lcong48, lrand48,
140            mrand48, nrand48, seed48, and srand48.
141        36: Added _cygwin_S_IEXEC, et al
142        37: [f]pathconv support _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY
143        38: vscanf, vscanf_r, and random pthread functions
144        39: asctime_r, ctime_r, gmtime_r, localtime_r
145        40: fchdir
146        41: __signgam
147        42: sys_errlist, sys_nerr
148        43: sigsetjmp, siglongjmp fixed
149        44: Export dirfd
150        45: perprocess change, gamma_r, gammaf_r, lgamma_r, lgammaf_r
151        46: Remove cygwin_getshared
152        47: Report EOTWarningZoneSize in struct mtget.
153        48: Export "posix" regex functions
154        49: Export setutent, endutent, utmpname, getutent, getutid, getutline.
155        50: Export fnmatch.
156        51: Export recvmsg, sendmsg.
157        52: Export strptime
158        53: Export strlcat, strlcpy.
159        54: Export __fpclassifyd, __fpclassifyf, __signbitd, __signbitf.
160        55: Export fcloseall, fcloseall_r.
161        56: Make ntsec on by default.
162        57: Export setgroups.
163        58: Export memalign, valloc, malloc_trim, malloc_usable_size, mallopt,
164            malloc_stats
165        59: getsid
166        60: MSG_NOSIGNAL
167        61: Export getc_unlocked, getchar_unlocked, putc_unlocked,
168            putchar_unlocked
169        62: Erroneously bumped
170        63: Export pututline
171        64: Export fseeko, ftello
172        65: Export siginterrupt
173        66: Export nl_langinfo
174        67: Export pthread_getsequence_np
175        68: Export netdb stuff
176        69: Export strtof
177        70: Export asprintf, _asprintf_r, vasprintf, _vasprintf_r
178        71: Export strerror_r
179        72: Export nanosleep
180        73: Export setreuid32, setreuid, setregid32, setregid
181        74: Export _strtold a64l hcreate hcreate_r hdestroy hdestroy_r hsearch
182                   hsearch_r isblank iswalnum iswalpha iswblank iswcntrl iswctype
183                   iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper
184                   iswxdigit l64a mbrlen mbrtowc mbsinit mbsrtowcs mempcpy
185                   on_exit setbuffer setlinebuf strndup strnlen tdelete tdestroy
186                   tfind towctrans towlower towupper tsearch twalk wcrtomb wcscat
187                   wcschr wcscpy wcscspn wcslcat wcslcpy wcsncat wcsncmp wcsncpy
188                   wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wctob wctob wctrans
189                   wctype wmemchr wmemcmp wmemcpy wmemmove wmemset
190        75: Export exp2 exp2f fdim fdimf fma fmaf fmax fmaxf fmin fminf lrint
191                   lrintf lround lroundf nearbyint nearbyintf remquo remquof
192                   round roundf scalbln scalblnf sincos sincosf tgamma tgammaf
193                   truncf
194        76: mallinfo
195        77: thread-safe exit/at_exit
196        78: Use stat and fstat rather than _stat, and _fstat.
197            Export btowc and trunc.
198        79: Export acl32 aclcheck32 aclfrommode32 aclfrompbits32 aclfromtext32
199                   aclsort32 acltomode32 acltopbits32 acltotext32 facl32
200                   fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 ftello64
201                   _open64 _lseek64 _fstat64 _stat64 mknod32
202        80: Export pthread_rwlock stuff
203        81: CW_CHECK_NTSEC addition to external.cc
204        82: Export wcscoll wcswidth wcwidth
205        83: Export gethostid
206        84: Pty open allocates invisible console.  64 bit interface
207        85: Export new 32/64 functions from API 0.79 only with leading
208            underscore.  No problems with backward compatibility since no
209            official release has been made so far.  This change removes
210            exported symbols like fopen64, which might confuse configure.
211        86: Export ftok
212        87: Export vsyslog
213        88: Export _getreent
214        89: Export __mempcpy
215        90: Export _fopen64
216        91: Export argz_add argz_add_sep argz_append argz_count argz_create
217            argz_create_sep argz_delete argz_extract argz_insert
218            argz_next argz_replace argz_stringify envz_add envz_entry
219            envz_get envz_merge envz_remove envz_strip
220        92: Export getusershell, setusershell, endusershell
221        93: Export daemon, forkpty, openpty, iruserok, ruserok, login_tty,
222            openpty, forkpty, revoke, logwtmp, updwtmp
223        94: Export getopt, getopt_long, optarg, opterr, optind, optopt,
224            optreset, __check_rhosts_file, __rcmd_errstr.
225        95: Export shmat, shmctl, shmdt, shmget.
226        96: CW_GET_ERRNO_FROM_WINERROR addition to external.cc
227        97: Export sem_open, sem_close, sem_timedwait, sem_getvalue.
228        98: Export _tmpfile64.
229        99: CW_GET_POSIX_SECURITY_ATTRIBUTE addition to external.cc.
230       100: CW_GET_SHMLBA addition to external.cc.
231       101: Export err, errx, verr, verrx, warn, warnx, vwarn, vwarnx.
232       102: CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID addition to external.cc.
233       103: Export getprogname, setprogname.
234       104: Export msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop.
235       105: Export sigwait.
236       106: Export flock.
237       107: Export fcntl64.
238       108: Remove unused (hopefully) reent_data export.
239       109: Oh well.  Someone uses reent_data.
240       110: Export clock_gettime, sigwaitinfo, timer_create, timer_delete,
241            timer_settime
242       111: Export sigqueue, sighold.
243       112: Redefine some mtget fields.
244       113: Again redefine some mtget fields.  Use mt_fileno and mt_blkno as
245            on Linux.
246       114: Export rand_r, ttyname_r.
247       115: Export flockfile, ftrylockfile, funlockfile, getgrgid_r, getgrnam_r,
248            getlogin_r.
249       116: Export atoll.
250       117: Export utmpx functions, Return utmp * from pututent.
251       118: Export getpriority, setpriority.
252       119: Export fdatasync.
253       120: Export basename, dirname.
254       122: Export statvfs, fstatvfs.
255       123: Export utmpxname.
256       124: Add MAP_AUTOGROW flag to mmap.
257       125: LD_PRELOAD/CW_HOOK available.
258       126: Export lsearch, lfind, timer_gettime.
259       127: Export sigrelese.
260       128: Export pselect.
261       129: Export mkdtemp.
262       130: Export strtoimax, strtoumax, llabs, imaxabs, lldiv, imaxdiv.
263       131: Export inet_ntop, inet_pton.
264       132: Add GLOB_LIMIT flag to glob.
265       133: Export __getline, __getdelim.
266       134: Export getline, getdelim.
267       135: Export pread, pwrite
268       136: Add TIOCMBIS/TIOCMBIC ioctl codes.
269       137: fts_children, fts_close, fts_get_clientptr, fts_get_stream,
270            fts_open, fts_read, fts_set, fts_set_clientptr, ftw, nftw.
271       138: Export readdir_r.
272       139: Start using POSIX definition of struct msghdr and WinSock2
273            IPPROTO_IP values.
274       140: Export mlock, munlock.
275       141: Export futimes, lutimes.
276       142: Export memmem
277       143: Export clock_getres, clock_setres
278       144: Export timelocal, timegm.
279       145: Add MAP_NORESERVE flag to mmap.
280       146: Change SI_USER definition.  FIXME: Need to develop compatibility
281            macro for this?
282       147: Eliminate problematic d_ino from dirent structure.  unsetenv now
283            returns int, as per linux.
284       148: Add open(2) flags O_SYNC, O_RSYNC, O_DSYNC and O_DIRECT.
285       149: Add open(2) flag O_NOFOLLOW.
286       150: Export getsubopt.
287       151: Export __opendir_with_d_ino
288       152: Revert to having d_ino in dirent unconditionally.
289       153: Export updwtmpx, Implement CW_SETUP_WINENV.
290       154: Export sigset, sigignore.
291       155: Export __isinff, __isinfd, __isnanf, __isnand.
292       156: Export __srbuf_r, __swget_r.
293       157: Export gai_strerror, getaddrinfo, getnameinfo, freeaddrinfo,
294            in6addr_any, in6addr_loopback.
295       158: Export bindresvport, bindresvport_sa, iruserok_sa, rcmd_af,
296            rresvport_af.
297       159: Export posix_openpt.
298       160: Export posix_fadvise, posix_fallocate.
299       161: Export resolver functions.
300       162: New struct ifreq.  Export if_nametoindex, if_indextoname,
301            if_nameindex, if_freenameindex.
302       163: Export posix_madvise, posix_memalign.
303       164: Export shm_open, shm_unlink.
304       165: Export mq_close, mq_getattr, mq_notify, mq_open, mq_receive,
305            mq_send, mq_setattr, mq_timedreceive, mq_timedsend, mq_unlink.
306       166: Export sem_unlink.
307       167: Add st_birthtim to struct stat.
308       168: Export asnprintf, dprintf, _Exit, vasnprintf, vdprintf.
309       169: Export confstr.
310       170: Export insque, remque.
311       171: Export exp10, exp10f, pow10, pow10f, strcasestr, funopen,
312            fopencookie.
313       172: Export getifaddrs, freeifaddrs.
314       173: Export __assert_func.
315       174: Export stpcpy, stpncpy.
316       175: Export fdopendir.
317       176: Export wcstol, wcstoll, wcstoul, wcstoull, wcsxfrm.
318       177: Export sys_sigabbrev
319       178: Export wcpcpy, wcpncpy.
320       179: Export _f_llrint, _f_llrintf, _f_llrintl, _f_lrint, _f_lrintf,
321            _f_lrintl, _f_rint, _f_rintf, _f_rintl, llrint, llrintf, llrintl,
322            rintl, lrintl, and redirect exports of lrint, lrintf, rint, rintf.
323       180: Export getxattr, lgetxattr, fgetxattr, listxattr, llistxattr,
324            flistxattr, setxattr, lsetxattr, fsetxattr, removexattr,
325            lremovexattr, fremovexattr.
326       181: Export cygwin_conv_path, cygwin_create_path, cygwin_conv_path_list.
327       182: Export lockf.
328      */
329
330      /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
331
332 #define CYGWIN_VERSION_API_MAJOR 0
333 #define CYGWIN_VERSION_API_MINOR 182
334
335      /* There is also a compatibity version number associated with the
336         shared memory regions.  It is incremented when incompatible
337         changes are made to the shared memory region *or* to any named
338         shared mutexes, semaphores, etc.   The arbitrary starting
339         version was 0 (cygwin release 98r2).
340         Bump to 4 since this hasn't been rigorously updated in a
341         while.  */
342
343 #define CYGWIN_VERSION_SHARED_DATA 4
344
345      /* An identifier used in the names used to create shared objects.
346         The full names include the CYGWIN_VERSION_SHARED_DATA version
347         as well as this identifier. */
348
349 #define CYGWIN_VERSION_DLL_IDENTIFIER   "cygwin1"
350
351      /* The Cygwin mount table interface in the Win32 registry also
352         has a version number associated with it in case that is
353         changed in a non-backwards compatible fashion.  Increment this
354         version number whenever incompatible changes in mount table
355         registry usage are made.
356
357         1: Original number version.
358         2: New mount registry layout, system-wide mount accessibility.
359      */
360
361 #define CYGWIN_VERSION_MOUNT_REGISTRY 2
362
363      /* Identifiers used in the Win32 registry. */
364
365 #define CYGWIN_INFO_CYGNUS_REGISTRY_NAME "Cygnus Solutions"
366 #define CYGWIN_INFO_CYGWIN_REGISTRY_NAME "Cygwin"
367 #define CYGWIN_INFO_PROGRAM_OPTIONS_NAME "Program Options"
368 #define CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME "mounts v2"
369 #define CYGWIN_INFO_CYGDRIVE_FLAGS "cygdrive flags"
370 #define CYGWIN_INFO_CYGDRIVE_PREFIX "cygdrive prefix"
371 #define CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX "/cygdrive"
372
373      /* In addition to the above version number strings, the build
374         process adds some strings that may be useful in
375         debugging/identifying a particular Cygwin DLL:
376
377         The mkvers.sh script at the top level produces a .cc file
378         which initializes a cygwin_version structure based on the
379         above version information and creates a string table for
380         grepping via "fgrep '%%%' cygwinwhatever.dll" if you are
381         using GNU grep.  Otherwise you may want to do a
382         "strings cygwinwhatever.dll | fgrep '%%%'" instead.
383
384         This will produce output such as:
385
386         %%% Cygwin dll_identifier: cygwin
387         %%% Cygwin api_major: 0
388         %%% Cygwin api_minor: 0
389         %%% Cygwin dll_major: 19
390         %%% Cygwin dll_minor: 6
391         %%% Cygwin shared_data: 1
392         %%% Cygwin registry: b15
393         %%% Cygwin build date: Wed Oct 14 16:26:51 EDT 1998
394         %%% Cygwin shared id: cygwinS1
395
396         This information can also be obtained through a call to
397         cygwin_internal (CW_GETVERSIONINFO).
398      */
399
400 #define CYGWIN_VERSION_MAGIC(a, b) ((unsigned) ((((unsigned short) a) << 16) | (unsigned short) b))
401 #define CYGWIN_VERSION_MAGIC_VERSION(a) ((unsigned) ((unsigned)a & 0xffff))