Mail Archives: djgpp-workers/1999/12/20/16:25:53
Bonjour M. Laurynas Biveinis
> Alain Magloire wrote:
> > I did not follow your discussion, but some functions that comes to mind
> > lstat()
> > lchown()
> > symlink()
> > readlink()
>
> All those functions are implemented.
>
> > link() unlink() // hard links
>
> Hard links are emulated in DJGPP by copying.
> My implementation does not deal with them at
> all.
>
> > Are you detecting loops ? and returning ELOOP
>
> I am detecting too many link levels and returning
> EMLINK. This catches loops too.
Posix does nto define symlink, IIRC.
But it should be in Unix98 or whatever new version they have.
[ELOOP] Too many symbolic links were encountered in resolving path.
[EMLINK] The link count of the parent directory would exceed {LINK_MAX}.
Again I did not follow the thread and my understand of DOS is to minimal
to do any sane comments on your work.
On a solaris mahine loops return ELOOP, EMLINK is return by mkdir ().
# uname -rs
SunOS 5.6
# mkdir A B
# cd A
# ln -s ../B/b a
# cd ../B
# ln -s ../A/a b
# cat m.c
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
int
main (int argc, char **argv)
{
int fd;
errno = 0;
fd = open (argv[1], O_RDONLY);
fprintf (stderr, "%d %s\n", errno, strerror(errno));
return 0;
}
# cc -o m m.c
# m b
./m b
90 Number of symbolic links encountered during path name traversal
exceeds MAXSYMLINKS
# grep ELOOP /usr/include/sys/errno.h
#define ELOOP 90 /* Symbolic link loop */
--
alain
- Raw text -