Re: sem_getvalue returns the semaphore count, while not setting the actual semaphore counter
On 24/09/2013 5:04 AM, Tue Henriksen wrote: problems with sem_getvalue function On success, it should return 0, otherwise -1. However, it looks like the function lately has been changed so it now returns the semaphore count, and leaves '*sval' unchanged. A patch to fix this was submitted recently [1], you might want to see whether the current snapshot has the fix yet [2]. [1] http://cygwin.com/ml/cygwin-patches/2013-q3/msg6.html [2] http://cygwin.com/snapshots/ Ryan -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: sem_getvalue returns the semaphore count, while not setting the actual semaphore counter
On Tue, Sep 24, 2013 at 05:16:58AM -0700, Ryan Johnson wrote: >On 24/09/2013 5:04 AM, Tue Henriksen wrote: >> problems with sem_getvalue function > >> On success, it should return 0, otherwise -1. However, it looks like the >> function lately has been changed so it now returns the semaphore count, and >> leaves '*sval' unchanged. >A patch to fix this was submitted recently [1], you might want to see >whether the current snapshot has the fix yet [2]. > >[1] http://cygwin.com/ml/cygwin-patches/2013-q3/msg6.html >[2] http://cygwin.com/snapshots/ This was not submitted. I asked some questions which the OP never answered. cgf -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
RE: Confused about several issues with setting up cron
> -Original Message- > From: KARR, DAVID > Sent: Sunday, September 22, 2013 2:32 PM > Subject: RE: Confused about several issues with setting up cron > > > -Original Message- > > Sent: Sunday, September 22, 2013 12:46 PM > > Subject: Re: Confused about several issues with setting up cron > > > > On 09/22/2013 05:56 PM, bartels wrote: > > > On 09/22/2013 03:00 AM, KARR, DAVID wrote: > > >> CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin > > >> > > >> I want to set up a cron job, so I have to get cron configured. I'm > trying > > to follow the instructions I can find, but I'm seeing several issues. > > >> > > >> I'm surprised that there's nothing in the user guide or the FAQ about > > setting up cron. I had to settle for the various questions about this > > >> on StackOverflow and others. > > > > > >>> I want to set up a cron job, so I have to get cron configured. I'm > > trying > > >> to follow the instructions I can find, but I'm seeing several issues. > > >>> I'm surprised that there's nothing in the user guide or the FAQ about > > >> setting up cron. I had to settle for the various questions about this > on > > >> StackOverflow and others. > > >> > > >> Must say your reporting of events is also lacking crucial elements > > >> If you re-install and give me more details, then I will try and answer > > your > > >> questions. > > > Ok. I assume you mean re-installing cron, not Cygwin. > > Yes, cron-config is what I meant. > > > > > > I followed the process described in the FAQ for removing a service. I > > then ran cron-config again. When I did this before, I selected to run > > cron as myself. I decided to make it run as the local system account this > > time (first running "passwd -R" and entering my password). It > > appeared to complete without errors or warnings. I did this in a "run as > > administrator" window. > > > > > > In a normal window, I then ran "crontab -e". I figured this would put > me > > into "vi" with an empty buffer. It just returned to the prompt. > > You should see a vi session. > > Do you have vi installed? > > What is the value of EDITOR? > > Yes, I have vi installed. EDITOR was blank, but I tried setting it to "vi" > and repeating the test, with no change. > > > This could indicate a deeper problem, confusing not just cron. > > > > > I then ran "crontab crontab" (the "crontab" file in my current directory > > is the file with the one job I want to run), and then did "crontab > > -l". Nothing. > > > > Are you familiar with the crontab format? If not, try this: > > $ man 5 crontab > > Yes, I am familiar with it, but here's the crontab I'm trying to set, in any > case: > > 0 * * * * monitorDataSource > > > > > > > I then went back to the administrator window. I ran "cronevents". This > > didn't show anything more than the cron service being started. I > > then ran "cronbug". I'm attaching the gzipped copy of this. > > > > > You will have more luck running cron 'as yourself': it is straightforward. > > Running it as a privileged user is more complicated. > > > > Is there a specific reason why you want to run it as system? > > No, only because running it as myself didn't work. > > In any case, I tried stopping and removing the service and rerunning cron- > config, running the service as myself. It didn't make any difference. No > response from "crontab -e", and "crontab crontab" seemingly ignored. Nothing > in "/var/log/cron.log", and nothing in "cronevents" except for the service > stopping and starting. Any more ideas about this? -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Confused about several issues with setting up cron
On 09/24/2013 05:04 PM, KARR, DAVID wrote: -Original Message- From: KARR, DAVID Sent: Sunday, September 22, 2013 2:32 PM Subject: RE: Confused about several issues with setting up cron -Original Message- Sent: Sunday, September 22, 2013 12:46 PM Subject: Re: Confused about several issues with setting up cron On 09/22/2013 05:56 PM, bartels wrote: On 09/22/2013 03:00 AM, KARR, DAVID wrote: CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin I want to set up a cron job, so I have to get cron configured. I'm trying to follow the instructions I can find, but I'm seeing several issues. I'm surprised that there's nothing in the user guide or the FAQ about setting up cron. I had to settle for the various questions about this on StackOverflow and others. >>> I want to set up a cron job, so I have to get cron configured. I'm trying >> to follow the instructions I can find, but I'm seeing several issues. >>> I'm surprised that there's nothing in the user guide or the FAQ about >> setting up cron. I had to settle for the various questions about this on >> StackOverflow and others. >> >> Must say your reporting of events is also lacking crucial elements >> If you re-install and give me more details, then I will try and answer your >> questions. > Ok. I assume you mean re-installing cron, not Cygwin. Yes, cron-config is what I meant. > > I followed the process described in the FAQ for removing a service. I then ran cron-config again. When I did this before, I selected to run cron as myself. I decided to make it run as the local system account this time (first running "passwd -R" and entering my password). It appeared to complete without errors or warnings. I did this in a "run as administrator" window. > > In a normal window, I then ran "crontab -e". I figured this would put me into "vi" with an empty buffer. It just returned to the prompt. You should see a vi session. Do you have vi installed? What is the value of EDITOR? Yes, I have vi installed. EDITOR was blank, but I tried setting it to "vi" and repeating the test, with no change. This could indicate a deeper problem, confusing not just cron. > I then ran "crontab crontab" (the "crontab" file in my current directory is the file with the one job I want to run), and then did "crontab -l". Nothing. Are you familiar with the crontab format? If not, try this: $ man 5 crontab Yes, I am familiar with it, but here's the crontab I'm trying to set, in any case: 0 * * * * monitorDataSource > > I then went back to the administrator window. I ran "cronevents". This didn't show anything more than the cron service being started. I then ran "cronbug". I'm attaching the gzipped copy of this. > You will have more luck running cron 'as yourself': it is straightforward. Running it as a privileged user is more complicated. Is there a specific reason why you want to run it as system? No, only because running it as myself didn't work. In any case, I tried stopping and removing the service and rerunning cron- config, running the service as myself. It didn't make any difference. No response from "crontab -e", and "crontab crontab" seemingly ignored. Nothing in "/var/log/cron.log", and nothing in "cronevents" except for the service stopping and starting. Any more ideas about this? I guess it is to do with privileges. cron works on my machines without fail: as system, and as privileged user If you look at the service $ cygrunsrv.exe -Q cron --verbose You can see that you can run cron from your own account like this: $ /usr/sbin/cron -n Anyway, the cron process needs read/write access to /var/cron/tabs/ No cron file there, means no cron jobs for you. The fact that you do not get an editor with 'crontab -e' is strange. I can only guess that EDITOR has a strange value, or crontab dies on privileges. Have you tried strace? $ strace -f crontab -e 2>&1 | tee strace.log You can probably see it dying. - bartels -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Confused about several issues with setting up cron
I would try the following methods: First make sure you are launching your local terminal with "Runas Administrator" checked, even if you are the Administrator user. I am also asuming you have done the normal stuff like cygcheck -c, and make sure you have not loaded duplicate dlls during your troubleshooting. If you ever get resource fork issues with parent != child error messages right in the term, that needs to be fixed by removing the duplicate dll file. And run /bin/rebaseall from dash or ash terminals (disable Anti-viri). Always manually right click and Run mintty as Administrator, also try changing the path in the mintty shortcut to c:\cygwin\bin\mintty.exe - % cygrunsrv -R cron reboot to be on the safe side After bootup use cygwin setup to uninstall cron, then run setup again and install it. % cron-config You shouldn't need todo anything custom here, yes and defaults to everything. It should be using your current user account, and that is hopefully the full fledged Administrator account, and not some other user with admin privs. Which also means you are currently logged into windows as the full Administrator account. % net start cron % EDITOR=vi or whatev % crontab -e create an entry that just fires of something basic very frequently for instance */1 * * * * echo "this" > /cygdrive/c/Users/ Administrator/Desktop/test.file.txt You many also want to throw in the PATH into the crontab itself for example: PATH=/bin:/usr/bin:/usr/local/bin As alternative to or in addition to the mentioned test.file.txt creation cron entry, you could use something like this: @reboot echo "this" > /cygdrive/c/Users/Administrator/Desktop/test.file.txt So that instead of something fireing off every minute for testing, it would fire it off each time you stop/start the cron service with "net stop cron" and "net start cron" Sorry for the messy response, i have no time right now. Good luck reading this email and getting it working. :) On Sat, Sep 21, 2013 at 6:00 PM, KARR, DAVID wrote: > CYGWIN_NT-6.1 1.7.25(0.270/5/3) 2013-08-31 20:39 i686 Cygwin > > I want to set up a cron job, so I have to get cron configured. I'm trying to > follow the instructions I can find, but I'm seeing several issues. > > I'm surprised that there's nothing in the user guide or the FAQ about setting > up cron. I had to settle for the various questions about this on > StackOverflow and others. > > I must have done something at least half correct, because I believe this > tells me that cron is running: > > % cygrunsrv -L > cron > > % cronevents > 2013/09/20 21:14:06 [dk068x] crontab: PID 5924: (dk068x) LIST (dk068x) > 2013/09/21 11:28:15 [dk068x] /usr/sbin/cron: PID 4980: (CRON) STARTUP (V5.0) > 2013/09/21 11:28:16 [dk068x] cron: PID 8424: `cron' service started > > However, I then do "crontab ", where > "pathtomycrontabfile" is the path to my crontab file with the job I want to > run. I then do "crontab -l" and it prints nothing. There is nothing in > "/var/log/cron*". > > I did get some errors when I ran "cron-config", but I unfortunately lost that > output. > > > -- > Problem reports: http://cygwin.com/problems.html > FAQ: http://cygwin.com/faq/ > Documentation: http://cygwin.com/docs.html > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: [PATCH] tests: don't assume getdtablesize () <= 10000000
[adding cygwin] On 04/29/2013 04:23 PM, Paul Eggert wrote: > --- > + > + tests: don't assume getdtablesize () <= 1000 > + * modules/cloexec-tests: > + * modules/dup2-tests: > + * modules/dup3-tests: > + * modules/nonblocking-tests: > + * modules/posix_spawn_file_actions_addclose-tests: > + * modules/posix_spawn_file_actions_adddup2-tests: > + * modules/posix_spawn_file_actions_addopen-tests: > + * modules/unistd-safer-tests: > + Depend on the getdtablesize module. > + * tests/test-cloexec.c: > + * tests/test-dup-safer.c: > + * tests/test-dup2.c: > + * tests/test-dup3.c: > + * tests/test-fcntl.c: > + * tests/test-nonblocking.c: > + * tests/test-posix_spawn_file_actions_addclose.c: > + * tests/test-posix_spawn_file_actions_adddup2.c: > + * tests/test-posix_spawn_file_actions_addopen.c: > + Don't assume getdtablesize () <= 1000. This patch causes failures on at least test-fcntl and test-dup2 on cygwin (both 32-bit and 64-bit); there, getdtablesize() currently returns the current runtime value, but this value starts at 256, and automatically expands as needed at runtime up to 3200. I think cygwin should be patched to make getdtablesize() return a constant 3200 (rather than the current runtime value); but meanwhile, we need to do something in gnulib to pick a larger value for bad_fd if getdtablesize() returns a small runtime value. I also wonder whether cygwin's sysconf(_SC_OPEN_MAX) should likewise be modified. (gdb) p getdtablesize() $5 = 256 (gdb) p dup2(0, 256) $6 = 256 (gdb) p getdtablesize() $7 = 288 (gdb) p dup2(0, 3200) $8 = -1 (gdb) p getdtablesize() $9 = 288 (gdb) p dup2(0, 3199) $10 = 3199 (gdb) p getdtablesize() $11 = 3200 -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature
Re: Confused about several issues with setting up cron
On 09/24/2013 08:13 PM, KARR, DAVID wrote: 15 31593 [main] crontab 8612 fhandler_base::open_fs: 0 = fhandler_disk_file::open(\??\C:\Cygwin\var\cron\tabs\dk068x, 0x8000) 21 31614 [main] crontab 8612 open: -1 = open(tabs/dk068x, 0x8000), errno 2 There you go: the process has no write access to your crontab file (C:\Cygwin\var\cron\tabs\dk068x) Popular advice on this list is that you do not mix posix and windoze permissions. I have fallen into that trap myself. - bartels -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
How does Cygwin handle non-Latin1 man pages? (move to UTF-8?)
Hi, As far as I see it, on Cygwin it is assumed that man pages are encoded in Latin-1 (ISO-8859-1). For instance the man pages of vim. /usr/share/man/fr/vim.1.gz is encoded in Latin-1. $ export LANG=fr_FR.UTF-8 $ man vim This will show the French man page correctly. Latin-1 is converted to UTF-8. For the Russian translation of the vim manual I see two files: /usr/share/man/ru.UTF-8/man1/vim.1.gz /usr/share/man/ru.KOI8-R/man1/vim.1.gz When I type $ export LANG=ru_RU.UTF-8 $ man vim I get the English man page, instead of the Russian man page. I think because there is no /usr/share/man/ru/man1/vim.1.gz present. When I type $ export LANG=ru_RU.UTF-8 $ export LANGUAGE=ru.UTF-8 $ man vim The Russian man page is displayed, but all Russian characters are wrongly displayed. I think because it is assumed the man page is in Latin-1. To get a correct display of the Russian man page I need to change /etc/man.config I change the line with NROFF to: NROFF /usr/bin/preconv | /usr/bin/nroff -c -mandoc 2>/dev/null Now the Russian man page displays correctly, but now all the Latin-1 pages display wrongly. So I undo my change in /etc/man.conf On Linux the trend is to convert all man pages to UTF-8 encoding. Will Cygwin follow this trend? regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
[ANNOUNCEMENT] Updated: m4-1.4.17-1
A new release of m4, 1.4.17-1, will soon be available on your favorite mirror. This is a new upstream release, and my first build of m4 for 64-bit cygwin; it replaces 1.4.16-1 on 32-bit cygwin, and 1.4.16-2 on 64-bit cygwin. NEWS: = This is a new upstream release, with the following upstream NEWS: ** Fix compilation with newer glibc headers. ** Fix a failure with diverting large amounts of text on mingw (does not affect platforms that can rename an open file). ** A number of portability improvements inherited from gnulib. Note that libsigsegv has still not been ported to 64-bit cygwin; as such, the 64-bit build of m4 cannot gracefully detect stack overflow even though the 32-bit build can. Also note that 'make check' fails on this build on current cygwin1.dll, due to a testsuite question about cygwin's getdtablesize() semantics; although the failure is harmless to m4's actual operation. You must rebuild from source if you want the experimental changeword feature enabled, as using it can slow down normal operation, and since it will disappear from the eventual m4 2.0. If you encounter a problem that might be cygwin-specific, please report it here rather than upstream. See also the upstream documentation in /usr/share/doc/m4/. DESCRIPTION: m4 is an implementation of the traditional Unix macro processor. It is mostly SVR4 compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). GNU m4 also has built-in functions for including files, running shell commands, doing arithmetic, etc. UPDATE: === To update your installation, click on the "Install Cygwin now" link on the http://cygwin.com/ web page. This downloads setup.exe to your system. Save it and run setup, answer the questions, and look for 'm4' in the 'Interpreters' category. DOWNLOAD: = Note that downloads from cygwin.com aren't allowed due to bandwidth limitations. This means that you will need to find a mirror which has this update, please choose the one nearest to you: http://cygwin.com/mirrors.html QUESTIONS: == If you want to make a point or ask a question the Cygwin mailing list is the appropriate place. -- Eric Blake volunteer cygwin m4 package maintainer CYGWIN-ANNOUNCE UNSUBSCRIBE INFO: = To unsubscribe to the cygwin-announce mailing list, look at the "List-Unsubscribe: " tag in the email header of this message. Send email to the address specified there. It will be in the format: cygwin-announce-unsubscribe-YOU=yourdomain@cygwin.com If you need more information on unsubscribing, start reading here: http://sourceware.org/lists.html#unsubscribe-simple Please read *all* of the information on unsubscribing that is available starting at this URL. signature.asc Description: OpenPGP digital signature
Run bash script in cmd with cygwin
Hello I would like to run this script `for file in `find . -name "*.po"` ; do msgfmt -o ${file/.po/.mo} $file ; done` in windows cmd. The script need to run in a different folder. I have been able to run it though cygwin but want to integrate it with another system where it will be run through cmd. C:\cygwin\bin D:\path\to\dir How can I do this? Thanks. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
RE: Running setup-x86_64.exe without admin privileges
Frédéric Bron sent the following at Tuesday, September 24, 2013 1:10 AM >I have built a version of setup-x86-64.exe for people that do >not have administrator privileges. It can be downloaded here: >http://www.casalibus.fr/cygwin/ Merci! For your next update: Trying to compress it with upx failed with an error message: upx: setup-x86-64.exe: CantPackException: can't pack new-exe The next time you update it, and if it is not too much bother, you might compile so upx works. Or not. I'm not complaining. Thanks again, - Barry Disclaimer: Statements made herein are not made on behalf of NIAID. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Run bash script in cmd with cygwin
Try adding this to your script: cd /cygdrive/d/path/to/dir;`for file.. Matt D. On 9/24/2013 5:43 PM, Ulrich Pogson wrote: Hello I would like to run this script `for file in `find . -name "*.po"` ; do msgfmt -o ${file/.po/.mo} $file ; done` in windows cmd. The script need to run in a different folder. I have been able to run it though cygwin but want to integrate it with another system where it will be run through cmd. C:\cygwin\bin D:\path\to\dir How can I do this? Thanks. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: [PATCH] tests: don't assume getdtablesize () <= 10000000
On Tue, Sep 24, 2013 at 12:37:26PM -0600, Eric Blake wrote: >[adding cygwin] > >On 04/29/2013 04:23 PM, Paul Eggert wrote: >> --- > >> + >> +tests: don't assume getdtablesize () <= 1000 >> +* modules/cloexec-tests: >> +* modules/dup2-tests: >> +* modules/dup3-tests: >> +* modules/nonblocking-tests: >> +* modules/posix_spawn_file_actions_addclose-tests: >> +* modules/posix_spawn_file_actions_adddup2-tests: >> +* modules/posix_spawn_file_actions_addopen-tests: >> +* modules/unistd-safer-tests: >> +Depend on the getdtablesize module. >> +* tests/test-cloexec.c: >> +* tests/test-dup-safer.c: >> +* tests/test-dup2.c: >> +* tests/test-dup3.c: >> +* tests/test-fcntl.c: >> +* tests/test-nonblocking.c: >> +* tests/test-posix_spawn_file_actions_addclose.c: >> +* tests/test-posix_spawn_file_actions_adddup2.c: >> +* tests/test-posix_spawn_file_actions_addopen.c: >> +Don't assume getdtablesize () <= 1000. > >This patch causes failures on at least test-fcntl and test-dup2 on >cygwin (both 32-bit and 64-bit); there, getdtablesize() currently >returns the current runtime value, but this value starts at 256, and >automatically expands as needed at runtime up to 3200. I think cygwin >should be patched to make getdtablesize() return a constant 3200 (rather >than the current runtime value); Why? What does "3200" have to do with anything? There is not supposed to be a hard-coded upper limit. cgf -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: Run bash script in cmd with cygwin
Thanks Matt, after try everything I could not get it to work. Could you give me the whole code that I could enter in cmd that would run cygwin and then run the script? On 24 September 2013 23:43, Ulrich Pogson wrote: > Hello > > I would like to run this script `for file in `find . -name "*.po"` ; > do msgfmt -o ${file/.po/.mo} $file ; done` in windows cmd. The script > need to run in a different folder. I have been able to run it though > cygwin but want to integrate it with another system where it will be > run through cmd. > > C:\cygwin\bin > D:\path\to\dir > > How can I do this? > > Thanks. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Re: [PATCH] tests: don't assume getdtablesize () <= 10000000
On 2013-09-25 06:32, Christopher Faylor wrote: > On Tue, Sep 24, 2013 at 12:37:26PM -0600, Eric Blake wrote: >> This patch causes failures on at least test-fcntl and test-dup2 on >> cygwin (both 32-bit and 64-bit); there, getdtablesize() currently >> returns the current runtime value, but this value starts at 256, and >> automatically expands as needed at runtime up to 3200. I think cygwin >> should be patched to make getdtablesize() return a constant 3200 (rather >> than the current runtime value); > > Why? What does "3200" have to do with anything? There is not supposed > to be a hard-coded upper limit. Go back and read the gdb session. STC in C: #include #include #include int main(void) { int ret = dup2(0, 3200); if (ret == -1) printf("3200 errno %d: %s\n", errno, strerror(errno)); else printf("3200 ok"); ret = dup2(0, 3199); if (ret == -1) printf("3199 errno %d: %s\n", errno, strerror(errno)); else printf("3199 ok"); return 0; } output on my system: 3200 errno 9: Bad file descriptor 3199 ok -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple