1 /* version.h -- Cygwin version numbers and accompanying documentation.
3 Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 2005, 2006, 2007, 2008, 2009 Red Hat, Inc.
6 This file is part of Cygwin.
8 This software is a copyrighted work licensed under the terms of the
9 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
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.
15 Historical versioning in Cygwin 16.0 to 19.5:
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.
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.
38 In October 1998 (starting with Cygwin 19.6), we started a new method
39 of Cygwin versioning: */
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. */
45 #define CYGWIN_VERSION_DLL_MAJOR 1007
46 #define CYGWIN_VERSION_DLL_MINOR 0
48 /* Major numbers before CYGWIN_VERSION_DLL_EPOCH are
51 #define CYGWIN_VERSION_DLL_EPOCH 19
53 /* CYGWIN_VERSION_DLL_COMBINED gives us a single number
54 representing the combined DLL major and minor numbers. */
56 /* WATCH OUT FOR OCTAL! Don't use, say, "00020" for 0.20 */
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)
62 /* Every version of cygwin <= this uses an old, incorrect method
63 to determine signal masks. */
65 #define CYGWIN_VERSION_USER_API_VERSION_COMBINED \
66 CYGWIN_VERSION_DLL_MAKE_COMBINED (user_data->api_major, user_data->api_minor)
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)
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)
80 #define CYGWIN_VERSION_CHECK_FOR_S_IEXEC \
81 (CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 36)
83 #define CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK \
84 (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 28)
86 #define CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES \
87 (CYGWIN_VERSION_USER_API_VERSION_COMBINED >= 79)
89 #define CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR \
90 (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 138)
92 #define CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES \
93 (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 138)
95 #define CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ \
96 (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 161)
98 #define CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE \
99 (CYGWIN_VERSION_USER_API_VERSION_COMBINED <= 209)
101 #define CYGWIN_VERSION_CYGWIN_CONV 181
103 /* API_MAJOR 0.0: Initial version. API_MINOR changes:
104 1: Export cygwin32_ calls as cygwin_ as well.
105 2: Export j1, jn, y1, yn.
106 3: Export dll_noncygwin_dllcrt0.
107 4: New socket ioctls, revamped ifconf support.
108 5: Thread support/exports.
109 6: Change in termios handling.
110 7: Export scandir and alphasort.
111 8: Export _ctype_, _sys_errlist, _sys_nerr.
112 9: Mount-related changes, new cygwin_umount export.
113 Raw device support (tape, floppies).
114 10: Fast math routine support added.
115 11: Export seekdir, telldir.
116 12: Export pthread_join, pthread_detach.
117 13: Export math funcs gamma and friends, also _j0, _j1, etc.
118 14: Export snprintf and vnsprintf.
120 16: Export cygwin_stackdump
121 17: Export fast math stuff
122 18: Stop exporting _strace_wm
123 19: Export fchown, lchown, lacl
124 20: regsub, inet_network
125 21: incompatible change to stdio cr/lf and buffering
126 22: Export cygwin_logon_user, cygwin_set_impersonation_token.
127 geteuid, getegid return effective uid/gid.
128 getuid, getgid return real uid/gid.
129 seteuid, setegid set only effective uid/gid.
130 setuid, setgid set effective and real uid/gid.
131 23: Export new dll_crt0 interface and cygwin_user_data for use
132 with crt0 startup code.
133 24: Export poll and _poll.
134 25: Export getmode and _getmode.
135 26: CW_GET_CYGDRIVE_PREFIXES addition to external.cc
136 27: CW_GETPINFO_FULL addition to external.cc
137 28: Accidentally bumped by cgf
139 30: CW_GET_CYGDRIVE_INFO addition to external.cc
141 32: Export getrlimit/setrlimit
142 33: Export setlogmask
143 34: Separated out mount table
144 35: Export drand48, erand48, jrand48, lcong48, lrand48,
145 mrand48, nrand48, seed48, and srand48.
146 36: Added _cygwin_S_IEXEC, et al
147 37: [f]pathconv support _PC_POSIX_PERMISSIONS and _PC_POSIX_SECURITY
148 38: vscanf, vscanf_r, and random pthread functions
149 39: asctime_r, ctime_r, gmtime_r, localtime_r
152 42: sys_errlist, sys_nerr
153 43: sigsetjmp, siglongjmp fixed
155 45: perprocess change, gamma_r, gammaf_r, lgamma_r, lgammaf_r
156 46: Remove cygwin_getshared
157 47: Report EOTWarningZoneSize in struct mtget.
158 48: Export "posix" regex functions
159 49: Export setutent, endutent, utmpname, getutent, getutid, getutline.
161 51: Export recvmsg, sendmsg.
163 53: Export strlcat, strlcpy.
164 54: Export __fpclassifyd, __fpclassifyf, __signbitd, __signbitf.
165 55: Export fcloseall, fcloseall_r.
166 56: Make ntsec on by default.
167 57: Export setgroups.
168 58: Export memalign, valloc, malloc_trim, malloc_usable_size, mallopt,
172 61: Export getc_unlocked, getchar_unlocked, putc_unlocked,
174 62: Erroneously bumped
176 64: Export fseeko, ftello
177 65: Export siginterrupt
178 66: Export nl_langinfo
179 67: Export pthread_getsequence_np
180 68: Export netdb stuff
182 70: Export asprintf, _asprintf_r, vasprintf, _vasprintf_r
183 71: Export strerror_r
185 73: Export setreuid32, setreuid, setregid32, setregid
186 74: Export _strtold a64l hcreate hcreate_r hdestroy hdestroy_r hsearch
187 hsearch_r isblank iswalnum iswalpha iswblank iswcntrl iswctype
188 iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper
189 iswxdigit l64a mbrlen mbrtowc mbsinit mbsrtowcs mempcpy
190 on_exit setbuffer setlinebuf strndup strnlen tdelete tdestroy
191 tfind towctrans towlower towupper tsearch twalk wcrtomb wcscat
192 wcschr wcscpy wcscspn wcslcat wcslcpy wcsncat wcsncmp wcsncpy
193 wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wctob wctob wctrans
194 wctype wmemchr wmemcmp wmemcpy wmemmove wmemset
195 75: Export exp2 exp2f fdim fdimf fma fmaf fmax fmaxf fmin fminf lrint
196 lrintf lround lroundf nearbyint nearbyintf remquo remquof
197 round roundf scalbln scalblnf sincos sincosf tgamma tgammaf
200 77: thread-safe exit/at_exit
201 78: Use stat and fstat rather than _stat, and _fstat.
202 Export btowc and trunc.
203 79: Export acl32 aclcheck32 aclfrommode32 aclfrompbits32 aclfromtext32
204 aclsort32 acltomode32 acltopbits32 acltotext32 facl32
205 fgetpos64 fopen64 freopen64 fseeko64 fsetpos64 ftello64
206 _open64 _lseek64 _fstat64 _stat64 mknod32
207 80: Export pthread_rwlock stuff
208 81: CW_CHECK_NTSEC addition to external.cc
209 82: Export wcscoll wcswidth wcwidth
211 84: Pty open allocates invisible console. 64 bit interface
212 85: Export new 32/64 functions from API 0.79 only with leading
213 underscore. No problems with backward compatibility since no
214 official release has been made so far. This change removes
215 exported symbols like fopen64, which might confuse configure.
221 91: Export argz_add argz_add_sep argz_append argz_count argz_create
222 argz_create_sep argz_delete argz_extract argz_insert
223 argz_next argz_replace argz_stringify envz_add envz_entry
224 envz_get envz_merge envz_remove envz_strip
225 92: Export getusershell, setusershell, endusershell
226 93: Export daemon, forkpty, openpty, iruserok, ruserok, login_tty,
227 openpty, forkpty, revoke, logwtmp, updwtmp
228 94: Export getopt, getopt_long, optarg, opterr, optind, optopt,
229 optreset, __check_rhosts_file, __rcmd_errstr.
230 95: Export shmat, shmctl, shmdt, shmget.
231 96: CW_GET_ERRNO_FROM_WINERROR addition to external.cc
232 97: Export sem_open, sem_close, sem_timedwait, sem_getvalue.
233 98: Export _tmpfile64.
234 99: CW_GET_POSIX_SECURITY_ATTRIBUTE addition to external.cc.
235 100: CW_GET_SHMLBA addition to external.cc.
236 101: Export err, errx, verr, verrx, warn, warnx, vwarn, vwarnx.
237 102: CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID addition to external.cc.
238 103: Export getprogname, setprogname.
239 104: Export msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop.
243 108: Remove unused (hopefully) reent_data export.
244 109: Oh well. Someone uses reent_data.
245 110: Export clock_gettime, sigwaitinfo, timer_create, timer_delete,
247 111: Export sigqueue, sighold.
248 112: Redefine some mtget fields.
249 113: Again redefine some mtget fields. Use mt_fileno and mt_blkno as
251 114: Export rand_r, ttyname_r.
252 115: Export flockfile, ftrylockfile, funlockfile, getgrgid_r, getgrnam_r,
255 117: Export utmpx functions, Return utmp * from pututent.
256 118: Export getpriority, setpriority.
257 119: Export fdatasync.
258 120: Export basename, dirname.
259 122: Export statvfs, fstatvfs.
260 123: Export utmpxname.
261 124: Add MAP_AUTOGROW flag to mmap.
262 125: LD_PRELOAD/CW_HOOK available.
263 126: Export lsearch, lfind, timer_gettime.
264 127: Export sigrelese.
267 130: Export strtoimax, strtoumax, llabs, imaxabs, lldiv, imaxdiv.
268 131: Export inet_ntop, inet_pton.
269 132: Add GLOB_LIMIT flag to glob.
270 133: Export __getline, __getdelim.
271 134: Export getline, getdelim.
272 135: Export pread, pwrite
273 136: Add TIOCMBIS/TIOCMBIC ioctl codes.
274 137: fts_children, fts_close, fts_get_clientptr, fts_get_stream,
275 fts_open, fts_read, fts_set, fts_set_clientptr, ftw, nftw.
276 138: Export readdir_r.
277 139: Start using POSIX definition of struct msghdr and WinSock2
279 140: Export mlock, munlock.
280 141: Export futimes, lutimes.
282 143: Export clock_getres, clock_setres
283 144: Export timelocal, timegm.
284 145: Add MAP_NORESERVE flag to mmap.
285 146: Change SI_USER definition. FIXME: Need to develop compatibility
287 147: Eliminate problematic d_ino from dirent structure. unsetenv now
288 returns int, as per linux.
289 148: Add open(2) flags O_SYNC, O_RSYNC, O_DSYNC and O_DIRECT.
290 149: Add open(2) flag O_NOFOLLOW.
291 150: Export getsubopt.
292 151: Export __opendir_with_d_ino
293 152: Revert to having d_ino in dirent unconditionally.
294 153: Export updwtmpx, Implement CW_SETUP_WINENV.
295 154: Export sigset, sigignore.
296 155: Export __isinff, __isinfd, __isnanf, __isnand.
297 156: Export __srbuf_r, __swget_r.
298 157: Export gai_strerror, getaddrinfo, getnameinfo, freeaddrinfo,
299 in6addr_any, in6addr_loopback.
300 158: Export bindresvport, bindresvport_sa, iruserok_sa, rcmd_af,
302 159: Export posix_openpt.
303 160: Export posix_fadvise, posix_fallocate.
304 161: Export resolver functions.
305 162: New struct ifreq. Export if_nametoindex, if_indextoname,
306 if_nameindex, if_freenameindex.
307 163: Export posix_madvise, posix_memalign.
308 164: Export shm_open, shm_unlink.
309 165: Export mq_close, mq_getattr, mq_notify, mq_open, mq_receive,
310 mq_send, mq_setattr, mq_timedreceive, mq_timedsend, mq_unlink.
311 166: Export sem_unlink.
312 167: Add st_birthtim to struct stat.
313 168: Export asnprintf, dprintf, _Exit, vasnprintf, vdprintf.
315 170: Export insque, remque.
316 171: Export exp10, exp10f, pow10, pow10f, strcasestr, funopen,
318 172: Export getifaddrs, freeifaddrs.
319 173: Export __assert_func.
320 174: Export stpcpy, stpncpy.
321 175: Export fdopendir.
322 176: Export wcstol, wcstoll, wcstoul, wcstoull, wcsxfrm.
323 177: Export sys_sigabbrev
324 178: Export wcpcpy, wcpncpy.
325 179: Export _f_llrint, _f_llrintf, _f_llrintl, _f_lrint, _f_lrintf,
326 _f_lrintl, _f_rint, _f_rintf, _f_rintl, llrint, llrintf, llrintl,
327 rintl, lrintl, and redirect exports of lrint, lrintf, rint, rintf.
328 180: Export getxattr, lgetxattr, fgetxattr, listxattr, llistxattr,
329 flistxattr, setxattr, lsetxattr, fsetxattr, removexattr,
330 lremovexattr, fremovexattr.
331 181: Export cygwin_conv_path, cygwin_create_path, cygwin_conv_path_list.
333 FIXME: Removed 12 year old and entirely wrong wprintf function at
334 this point. We need a working implementation soon.
335 183: Export open_memstream, fmemopen.
336 184: Export openat, faccessat, fchmodat, fchownat, fstatat, futimesat,
337 linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat, symlinkat,
339 185: Export futimens, utimensat.
340 186: Remove ancient V8 regexp functions. Also eliminate old crt0 interface
341 which provided its own user_data structure.
342 187: Export cfmakeraw.
343 188: Export CW_SET_PRIV_KEY.
344 189: Implement dirent.d_type.
345 190: Export fgetwc, fgetws, fputwc, fputws, fwide, getwc, getwchar,
346 putwc, putwchar, ungetwc.
347 191: Export glob_pattern_p
348 192: CW_SETERRNO added
350 194: fcntl.h flags O_DIRECTORY, O_EXEC and O_SEARCH added.
351 195: Export wcstod, wcstof.
353 197: Export wcstoimax, wcstoumax.
354 198: Export reallocf.
355 199: Export open_wmemstream.
356 200: Export mbsnrtowcs, wcsnrtombs.
357 201: Export wprintf, fwprintf, swprintf, vwprintf, vfwprintf, vswprintf.
358 202: Export gethostbyname2.
359 203: Export wcsftime.
360 204: recv/send flag MSG_DONTWAIT added.
361 205: Export wscanf, fwscanf, swscanf, vwscanf, vfwscanf, vswscanf.
362 206: Export wcscasecmp, wcsncasecmp.
364 208: Export log2, log2f.
365 209: Export wordexp, wordfree.
366 210: New ctype layout using variable ctype pointer. Export __ctype_ptr__.
369 /* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
371 #define CYGWIN_VERSION_API_MAJOR 0
372 #define CYGWIN_VERSION_API_MINOR 210
374 /* There is also a compatibity version number associated with the
375 shared memory regions. It is incremented when incompatible
376 changes are made to the shared memory region *or* to any named
377 shared mutexes, semaphores, etc. The arbitrary starting
378 version was 0 (cygwin release 98r2).
379 Bump to 4 since this hasn't been rigorously updated in a
382 #define CYGWIN_VERSION_SHARED_DATA 5
384 /* An identifier used in the names used to create shared objects.
385 The full names include the CYGWIN_VERSION_SHARED_DATA version
386 as well as this identifier. */
388 #define CYGWIN_VERSION_DLL_IDENTIFIER "cygwin1"
390 /* The Cygwin mount table interface in the Win32 registry also
391 has a version number associated with it in case that is
392 changed in a non-backwards compatible fashion. Increment this
393 version number whenever incompatible changes in mount table
394 registry usage are made.
396 1: Original number version.
397 2: New mount registry layout, system-wide mount accessibility.
398 3: The mount table is not in the registry anymore, but in /etc/fstab.
401 #define CYGWIN_VERSION_MOUNT_REGISTRY 3
403 /* Identifiers used in the Win32 registry. */
405 #define CYGWIN_INFO_CYGWIN_REGISTRY_NAME "Cygwin"
406 #define CYGWIN_INFO_PROGRAM_OPTIONS_NAME "Program Options"
408 /* The default cygdrive prefix. */
410 #define CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX "/cygdrive"
412 /* In addition to the above version number strings, the build
413 process adds some strings that may be useful in
414 debugging/identifying a particular Cygwin DLL:
416 The mkvers.sh script at the top level produces a .cc file
417 which initializes a cygwin_version structure based on the
418 above version information and creates a string table for
419 grepping via "fgrep '%%%' cygwinwhatever.dll" if you are
420 using GNU grep. Otherwise you may want to do a
421 "strings cygwinwhatever.dll | fgrep '%%%'" instead.
423 This will produce output such as:
425 %%% Cygwin dll_identifier: cygwin
426 %%% Cygwin api_major: 0
427 %%% Cygwin api_minor: 0
428 %%% Cygwin dll_major: 19
429 %%% Cygwin dll_minor: 6
430 %%% Cygwin shared_data: 1
431 %%% Cygwin registry: b15
432 %%% Cygwin build date: Wed Oct 14 16:26:51 EDT 1998
433 %%% Cygwin shared id: cygwinS1
435 This information can also be obtained through a call to
436 cygwin_internal (CW_GETVERSIONINFO).
439 #define CYGWIN_VERSION_MAGIC(a, b) ((unsigned) ((((unsigned short) a) << 16) | (unsigned short) b))
440 #define CYGWIN_VERSION_MAGIC_VERSION(a) ((unsigned) ((unsigned)a & 0xffff))