On Thu, Jun 21, 2001 at 09:45:04PM -0400, Roland McGrath wrote:
> > neal@desdemona:~/foo (0)$ ls ""
> > ls: : No such file or directory
>
> Please look into this. Your other tests are consistent with everything
> else being correct and this being wrong. Does it make it as far as
> diskfs_S_dir_lookup?
Yes, something must be going wrong. I wrote the following small
program:
#define _GNU_SOURCE
#include <stdio.h>
#include <errno.h>
#include <error.h>
#include <hurd.h>
#include <fcntl.h>
#include <hurd/fs.h>
int main (int argc, char *argv[])
{
file_t file;
error_t err;
if (argc != 2)
error (1, 0, "Usage: %s file", argv[0]);
file = file_name_lookup (argv[1], O_READ, 0);
if (file == MACH_PORT_NULL)
error (1, errno, "Looking up %s", argv[1]);
printf ("Got a port to `%s'.\n", argv[1]);
err = dir_mkdir (file, "boohbah", 0);
if (err)
error (1, err, "Making boohbah");
return 0;
}
Here are the results:
neal@desdemona:~/build-libc/foo (0)$ ls -l
total 12
-rw-r--r-- 1 neal neal 0 Jun 20 22:44 a
-rw-r--r-- 1 neal neal 0 Jun 20 22:44 b
lrwxr-xr-x 1 neal neal 1 Jun 21 20:34 bar -> .
-rw-r--r-- 1 neal neal 0 Jun 20 22:44 c
lrwxr-xr-x 1 neal neal 0 Jun 20 22:44 foo ->
-rwxr-xr-x 1 neal neal 5712 Jun 21 22:32 mkdir
-rw-r--r-- 1 neal neal 544 Jun 21 22:32 mkdir.c
neal@desdemona:~/build-libc/foo (0)$ ./mkdir ""
Got a port to `'.
neal@desdemona:~/build-libc/foo (0)$ ls -l
total 16
-rw-r--r-- 1 neal neal 0 Jun 20 22:44 a
-rw-r--r-- 1 neal neal 0 Jun 20 22:44 b
lrwxr-xr-x 1 neal neal 1 Jun 21 20:34 bar -> .
d--------- 2 neal neal 4096 Jun 21 22:34 boohbah
-rw-r--r-- 1 neal neal 0 Jun 20 22:44 c
lrwxr-xr-x 1 neal neal 0 Jun 20 22:44 foo ->
-rwxr-xr-x 1 neal neal 5712 Jun 21 22:32 mkdir
-rw-r--r-- 1 neal neal 544 Jun 21 22:32 mkdir.c
neal@desdemona:~/build-libc/foo (0)$
Seems to work fairly well in this scenario.
PGP signature