Mail Archives: cygwin/2005/01/25/08:48:54
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The pathchk executable changed between coreutils 5.2.1 (where it stat'ed
every component of the path name) and coreutils 5.3.0 (it now calls a
single lstat() on the entire name) in how it checks for invalid filenames.
This causes a regression on the following sequence:
$ touch file
$ pathchk --version | head -n 1
pathchk (GNU coreutils) 5.2.1
$ ~/coreutils-5.3.0/src/pathchk --version | head -n 1
pathchk (GNU coreutils) 5.3.0
$ pathchk file/x; echo $?
pathchk: `file' is not a directory
1
$ ~/coreutils-5.3.0/src/pathchk file/x; echo $?
0
$
It looks like the lstat() call is violating POSIX - it should be checking
the path prefix, note that `file' is not a directory, and set errno to
ENOTDIR, but instead it is just setting ENOENT.
Also, I noticed there is no setpriority() or getpriority(), but nice() is
provided in <unistd.h> which does the same thing. It looks like
winsup/cygwin/syscalls.cc always returns 0 in nice() on success, contrary
to POSIX (it should be the new nice value, between -NZERO and NZERO-1).
Furthermore, there is no definition of NZERO in <limits.h>, but POSIX
requires it to be defined, and at least 20, if nice() is implemented.
Ultimately, `nice nice' should print 10, not 0. But since Windows only
provides 4 priority levels, cygwin should maintain a separate "nice value"
per process that is mapped into Windows values, something like: -20 to
- -11, -10 to -1, 0 to 9, and 10 to 19. That would make 'nice 1 nice' print
1, but not change the process priority; but 'nice nice' would print 10 and
lower the priority.
- --
Life is short - so eat dessert first!
Eric Blake ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFB9k3K84KuGfSFAYARAqoWAJwJWTlUTPalGNZnPBSZbnfPCG2muQCgso1s
HJhKKgV6i1NmsNhJZ1JkF6k=
=rY2T
-----END PGP SIGNATURE-----
--
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/
- Raw text -