Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-12-02
08:17 • Closed ticket [1001325fff]: readdir_r() is different on IRIX 5.3 plus 6 othe... artifact: a3969391ce user: dgp
2004-11-30
00:45 • Ticket [1001325fff]: 4 changes artifact: 0e5df3f1bb user: jenglish
2004-11-29
22:58 • Ticket [1001325fff]: 1 change artifact: 70987dfaa4 user: dgp
22:58 • Ticket [1001325fff]: 4 changes artifact: 90f059076e user: dgp
22:55 • Ticket [1001325fff]: 5 changes artifact: 9ffe91ac43 user: kennykb
2004-11-25
05:00 • Ticket [1001325fff]: 4 changes artifact: 61b44783c7 user: dgp
05:00 • Open ticket [1001325fff]. artifact: b73f297718 user: dgp
03:22 • Closed ticket [1001325fff]. artifact: 4c4ececfe6 user: kennykb
01:41 • Ticket [1001325fff]: 5 changes artifact: 73b06788ac user: dgp
01:41 • Add attachment autoconf.patch to ticket [1001325fff] artifact: bc11db9e6f user: dgp
01:13 • Ticket [1001325fff] readdir_r() is different on IRIX 5.3 status still Open w... artifact: 49bda49376 user: kennykb
01:13 • Add attachment 1001325.patch to ticket [1001325fff] artifact: bc6d481ccf user: kennykb
01:13 • Open ticket [1001325fff]: readdir_r() is different on IRIX 5.3 plus 5 other ... artifact: 73b507b2f5 user: kennykb
2004-11-23
05:40 • Closed ticket [1001325fff]. artifact: a477395af1 user: mdejong
2004-11-18
06:40 • Ticket [1001325fff]: 4 changes artifact: 74fe252a5c user: gschwarz
2004-09-24
13:17 • Add attachment readdir_r.patch to ticket [1001325fff] artifact: 385c9fd88c user: mdejong
13:17 • Ticket [1001325fff] readdir_r() is different on IRIX 5.3 status still Open w... artifact: e0541d140b user: mdejong
2004-07-31
22:55 • New ticket [1001325fff]. artifact: be743f2c16 user: nobody

readdir_r() is different on IRIX 5.3

Closed / Fixed1001325fffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-07-31 22:55:41
When compiling tcl 8.4.7 on IRIX 5.3 with --enable-threads one ends up with
cfe: Error: ./../unix/tclUnixThrd.c, line 837: The number of arguments doesn't agree with the number in the declaration.
     if (readdir_r (dir, ent, &ent) != 0) {
 ------------------^
*** Error code 1 (bu21)

This is because on IRIX 5.3 readdir_r() is

 struct dirent *readdir_r (DIR *dirp, struct dirent *res);

unix/tclUnixThrd.c thushas to be changed on IRIX 5.3 into

#ifdef HAVE_READDIR_R
    ent = &tsdPtr->rdbuf.ent;
/*    if (TclOSreaddir_r(dir, ent, &ent) != 0) {
        ent = NULL;
    }
*/
        ent=TclOSreaddir_r(dir, ent);

#else /* !HAVE_READDIR_R */

ideally the configure tools should detect which version of readdir_r is being used on a given platform.
mdejongplain2004-09-24 13:17:00
File Added - 102636: readdir_r.patch

Logged In: YES 
user_id=90858

Could someone with an IRIX 5.3 system try this patch? It should
detect the 2 or 3 arg version of readdir_r, but it has had
no testing.
gschwarzplain2004-11-18 06:40:01
Logged In: YES 
user_id=951222

I've applied that patch to 8.4.7, and it now compiles on IRIX 
5.3.
mdejong Closed ticket [1001325fff]. [History diff]2004-11-23 05:40:46
kennykbplain2004-11-25 01:13:50
Logged In: YES 
user_id=99768

Mo's change breaks an ordinary Linux-IA32 build, because NULL
is undefined unless <stdlib.h> is included.  Don, could you
rerun
autoconf with the attached 1001325.patch? (I don't have 2.13 to
and at the moment.)
kennykbplain2004-11-25 01:13:51
File Added - 109993: 1001325.patch
dgpplain2004-11-25 01:41:56
File Added - 109995: autoconf.patch

Logged In: YES 
user_id=80530

new patch includes
outcome of running
autoconf-2.13.
kennykbplain2004-11-25 03:22:45
Logged In: YES 
user_id=99768

Correction applied to both HEAD and 8.4 branch
dgp Open ticket [1001325fff]. [History diff]2004-11-25 05:00:37
dgpplain2004-11-25 05:00:38
Logged In: YES 
user_id=80530

See 1071701.  Things are
still broken.
kennykbplain2004-11-29 22:55:39
Logged In: YES 
user_id=99768

I see that you closed 1071701 - is this bug now fixed also?
dgpplain2004-11-29 22:58:04
Logged In: YES 
user_id=80530


It would be best for someone with
and IRIX 5.3 system to say for sure.
dgp Ticket [1001325fff]: 1 change [History diff]2004-11-29 22:58:55
jenglishplain2004-11-30 00:45:18
Logged In: YES 
user_id=68433

A suggestion: don't  use readdir_r() at all, unless it can
be demonstrated that readdir() is in fact broken on the host
platform.

On most systems (including IRIX 5.3 AFAICT), readdir() is
perfectly thread-safe as long as you don't share the same
DIR * across multiple threads (which Tcl doesn't do).
dgpplain2004-12-02 08:17:56
Logged In: YES 
user_id=80530

unless someone says
otherwise, I believe this is fixed
for Tcl 8.4.9.

jenglish''s suggestion is a
good one to explore in 8.5 development.
Log in (anonymous is fine) to add a comment.

Attachments: