This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Known Issues: document missing POSIX compliance and other unexpected behaviour
- From: Reini Urban <rurban at x-ray dot at>
- To: cygwin <cygwin at cygwin dot com>
- Date: Wed, 06 Oct 2004 17:11:03 +0200
- Subject: Known Issues: document missing POSIX compliance and other unexpected behaviour
I found no document where missing POSIX functionality is listed
and where other non-POSIX but expected typical UNIX functionality and/or
behaviour are different or missing. The user guide is a bit short on that.
This should help UNIX developers and should go the the user guide
(or FAQ?) then.
Unsolved issues (such as some Ghanshyam items) should go to bugzilla then.
I'd like to use a wiki page for that. (bugzilla not applicable)
Which wiki?
I'd suggest http://www.mega-tokyo.com/osfaq2/index.php/Cygwin
(CygwinIssues page) because this runs on my wiki engine :)
We could also abuse a wikipedia subpage of
http://en.wikipedia.org/wiki/Cygwin.
Before adding your fixes below in a reply, please please let's talk
first where to do that actually. Mailinglist not preferred.
Known Issues:
=============
First see the user-guide http://cygwin.com/cygwin-ug-net/highlights.html
and http://cygwin.com/cygwin-ug-net/using.html ff. for the definitive
answers.
strictly NON-POSIX:
===================
fopen(): Ghanshyam listed several NON-POSIX issues starting with
http://www.cygwin.com/ml/cygwin/2004-03/msg00357.html
sysconf():
http://www.cygwin.com/ml/cygwin/2004-03/msg01193.html
strftime():
http://www.cygwin.com/ml/cygwin/2004-03/msg01192.html
sigaction():
http://www.cygwin.com/ml/cygwin/2004-03/msg01194.html
TODO: find and document more problems.
Unexpected Behaviour:
====================
filesystem related:
-------------------
case-insensitive search:
Windows filesystems are usually case-insensitive in search, but
case-preservant (I know of 5 windows fs in general use, NTFS5 as
best, a new one on the horizon). For POSIX compatibility there's no
optional option or flag to restrict searches
(open,fopen,readdir,unlink,...) to be case-sensitive.
You can only tell your filesystem to be case-sensitive (somewhere
in the registry, which is not recommended and unrealistic), use
special cygwin managed mounts (mount -o managed) or check
case-sensitivity explicitly in your code. Best is to avoid such
issues beforehand, not allowing only case-different filenames.
But with user-created plugins it will get complicated.
unlink():
* unlink isn't atomic (as on other platforms also)
=> while (!unlink(..) or end-of-waiting()) {sleep}
On cygwin unlink() is deferred to the end of the process,
when unlink fails because of locks or delete on close
(ERROR_SHARING_VIOLATION).
* unlink a file and subsequent creation of a new file
in the same loction is not supported.
* "delete on close" (unlinking an open file) is supported.
passing file descriptors:
* you cannot pass file descriptors between seperate processes.
See http://www.cygwin.com/ml/cygwin-patches/2002-q3/msg00003.html
for description and workarounds.
(There's more. clamav came up with a patch recently, which has
a good workaround as easy to use code-snippet)
hardlinks:
* hardlinking directories is only available to the superuser
'ln -d', ...
* junctions are almost equivalent to symlinks, but symlinks are
implemented in cygwin differently and slower.
junctions on filenames do not exists to my knowledge, only
native hardlinks, which cygwin supports (for filenames at
least, see above).
(TODO: native symlinks)
mount:
mounting filesystems and devices are not supported.
TODO
device limitations:
explain about our device mapping, special block/char devices,
other magic devices like sockets, fifo's, ...
TODO
special filenames:
http://cygwin.com/cygwin-ug-net/using-specialnames.html
* using (esp. unlinking) "NUL" and other special filenames is
problematic (see FAQ and windows-special "\\.\" and "\??\" paths).
"DEL \\.\c:\somedir\nul"
getfacl/setfacl:
see user guide <url>
cygwin ACL's are not 1:1 mapped to windows ACL's,
esp. for inherited directory permissions. (?)
TODO
select():
see http://cygwin.com/cygwin-ug-net/highlights.html#OV-HI-SELECT
TODO
sync():
TODO SUSv3
security:
---------
See http://cygwin.com/cygwin-ug-net/ntsec.html,
http://cygwin.com/faq/faq_3.html#SEC78, sysbash,
network shares, samba, windows profiles, ...
setuid/su/login/cron:
* UNIX root uid is 0, windows SYSTEM uid is 18.
* cygwin cron usually runs as user SYSTEM and therefore ...
(network shares, file permissions, ...) TODO
* TODO: setuid,setgid file permission flag and workarounds.
* setuid()/setgid() process workarounds.
see http://cygwin.com/cygwin-ug-net/ntsec.html#NTSEC-SETUID
* TODO: setsid()/setpgid(): ??
* TODO: su,sudo vs runas ...
* TODO: login limitations
processes
---------
See the user-guide on fork, ipc, COFF, ...
fork:
see http://cygwin.com/faq/faq_3.html#SEC74 and
http://cygwin.com/cygwin-ug-net/highlights.html#OV-HI-PROCESS
PID's:
Unfortunately cygwin must use seperate PID's than the
underlying windows PID's.
http://cygwin.com/cygwin-ug-net/highlights.html#OV-HI-PROCESS
IPC:
* requires the cygserver daemon
* not fully supported on Win95 yet. TODO
threads:
* -lpthread is supported by cygwin1.dll,
libpthread.a is jut an import library.
* PROCESS_SHARED objects may not work (?, R.Collins, April 2001)
* pshared mutexs (?)
* signals cannot interrupt semaphores: semaphore::_trywait
load average:
* top misses the load average statistics.
no one came up with a comparable solution yet.
(how about getrusage(), ...)
DLL:
See http://cygwin.com/cygwin-ug-net/dll.html and
http://cygwin.com/faq/faq_3.html#SEC108
* building a .dll requires more steps than building an .so
google for "Microsoft designers must have been on crack",
special MSVC-like __declspec EXPORT declarations, ...
We use specially named import libraries named like
"lib<package>-version>.dll.a",
The shared libs like "cyg<package>-<version>.dll",
and must reside in the PATH.
* lazy linking is not yet supported.
see wine and MSVC. (info for windows folks only)
* all exported symbols must be relocatable and known at load-time.
See gcc -shared, dlltool, dllwrap and libtool.
console:
--------
* bash / rxvt TODO
* pty / tty issues TODO
* pipes
* bash PID reuse problem
....
--
Reini
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/