symlink.c 591 B

1234567891011121314151617181920212223242526
  1. /*
  2. * symlink() for uClibc
  3. *
  4. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  5. *
  6. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  7. */
  8. #include <sys/syscall.h>
  9. #if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K
  10. # include <unistd.h>
  11. # if defined __NR_symlinkat && !defined __NR_symlink
  12. # include <fcntl.h>
  13. int symlink(const char *oldpath, const char *newpath)
  14. {
  15. return symlinkat(oldpath, AT_FDCWD, newpath);
  16. }
  17. # elif defined(__NR_symlink)
  18. _syscall2(int, symlink, const char *, oldpath, const char *, newpath)
  19. # endif
  20. #endif