link.c 477 B

1234567891011121314151617181920
  1. /*
  2. * link() 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. #include <unistd.h>
  10. #if defined __NR_linkat && !defined __NR_link
  11. # include <fcntl.h>
  12. int link(const char *oldpath, const char *newpath)
  13. {
  14. return linkat(AT_FDCWD, oldpath, AT_FDCWD, newpath, 0);
  15. }
  16. #else
  17. _syscall2(int, link, const char *, oldpath, const char *, newpath)
  18. #endif