home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.sys5.r4
- Path: sparky!uunet!sarto!jhpb
- From: jhpb@sarto.budd-lake.nj.us (Joseph H. Buehler)
- Subject: SVR4.0.3A putw() bug
- Message-ID: <JHPB.92Dec12121811@sarto.budd-lake.nj.us>
- Sender: jhpb@sarto.budd-lake.nj.us (Joseph H Buehler)
- Organization: none
- Date: Sat, 12 Dec 1992 17:18:11 GMT
- Lines: 23
-
- I have been having some problems with the GNU locate program (GNU find
- 3.6 and 3.7), and finally got around to debugging it. It turns out
- that there is a bug in the ESIX SVR4.0.3A putw() routine in the C
- shared library. The following program demonstrates it:
-
- /* compile with: cc -o file file.c */
- #include <stdio.h>
- main()
- {
- int i;
- for (i=0; i<1022; ++i) {
- putchar('1');
- }
- putw(-11, stdout);
- for (i=0; i<1022; ++i) {
- putchar('1');
- }
- }
-
- The putw() routine does not output 4 bytes, as it should. I suspect
- there is some interaction with buffer flushing that is causing the
- problem. Also, note that if you change the sign of the first argument
- to putw(), the program works fine.
-