mkstemp failing in local_create_file on Linux/390

Adam Thornton adam at fsf.net
Wed Feb 28 05:16:14 CET 2001


I can't get mkstemp to do the right thing.  Is the leading null on the
string causing problems?  Why would it be there?

175         fd = mkstemp(nodename);
(gdb) p nodename
$1 = "(null)/vicepa/inodeXXXXXX", '\000' <repeats 4069 times>

(gdb) s
0x4012b3c4 in mkstemp () at mkstemp.c:31
31      mkstemp.c: No such file or directory.
(gdb) p errno
$2 = 2
(gdb) s
volcreate: create_volume returned: 2

Program exited with code 02.

Error 2 would be ENOENT.

But, uh, there shouldn't be an entry there, right?  And when I 

lgate-is:~ # cat testtemp.c ; cc -o testtemp testtemp.c ; ls /vicepa ; ./testtemp ; sleep 5 ; ls /vicepa
#include <stdlib.h>
int main(int argc, char **argv) {
    return mkstemp("/vicepa/inodeXXXXXX");
}
.  ..  lost+found
.  ..  inode0s5DRG  lost+found

So the system call works.  So I'm guessing that it's that leading null.
Where is it coming from?

Adam





More information about the Arla-drinkers mailing list