.
D 2005-01-05T07:39:18
J icomment Logged\sIn:\sYES\s\nuser_id=68433\n\nPatch\sattached;\stested\swith\sCVS\sHEAD,\son\sMandrake\sLinux\n10.0,\s--enable-symbols\s--enable-threads\s--disable-shared;\sno\ntest\sfailures.\n\nOne\smore\snote:\s\sThe\sSunOS\sman\spages\sinsist\sthat\sreaddir()\sis\nnot\sMT-safe\sand\sshould\snot\sbe\sused\sin\smultithreaded\napplications.\s\sAs\snear\sas\sI\sam\sable\sto\sdetermine,\sthis\sis\nsimply\snot\strue.\n\nThe\sAPI\sitself\shas\sno\sthread-safety\sissues\sas\slong\sas\sthe\nprogram\sdoes\snot\suse\sthe\ssame\sDIR\spointer\sin\smultiple\nthreads\s(i.e.,\sit's\sno\smore\sMT-unsafe\sthan,\ssay,\slseek()\sor\nwrite()).\s\sThe\sSuS\srequires\sthat\sindependant\scalls\sto\nreaddir()\son\sdistinct\sDIR\spointers\snot\sinterfere\swith\sone\nanother;\sall\sof\sthe\sreaddir()\simplementations\sI've\sbeen\sable\nto\sfind\s(glibc,\svarious\sBSDs,\sIRIX)\sare\sthread-safe\ssubject\nto\sthe\sabove\sconstraint;\saccording\sto\sGoogle\sthe\straditional\nimplementation\sis\sMT-safe\sas\swell;\sand\sif\syou\sthink\sabout\nit,\sit\swould\sbe\smore\swork\sto\simplement\sreaddir()\sin\sa\sway\nthat's\s*not*\sMT-safe\s(subject\sto\sthe\sabove\sconstraint)\sthan\nit\swould\sbe\sto\simplement\sone\sthat\sis.\n\nConsidering\sthe\sproblems\swith\sreaddir_r,\sboth\shistorical\sand\ninherent,\susing\sit\sin\sfavor\sof\sthe\straditional\sreaddir()\nseems\squite\sstrongly\scontraindicated.\s\sLet's\slose\sthe\n#ifdeffery\shere;\sit's\sdoing\smore\sharm\sthan\sgood.\n\n\n
J login jenglish
J mimetype text/plain
J username jenglish
K 1095909fffffffffffffffffffffffffffffffff
U jenglish
Z 897f3d069acc59b3e17e2df25923bf97