mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Linux: consolidate link implementation
Use link syscall if defined, otherwise use linkat. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
committed by
Adhemerval Zanella
parent
25ca6175ba
commit
f178e5173f
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (C) 2011-2022 Free Software Foundation, Inc.
|
/* Make a new name for a file. Linux version.
|
||||||
|
Copyright (C) 2011-2022 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -23,7 +24,11 @@
|
|||||||
int
|
int
|
||||||
__link (const char *from, const char *to)
|
__link (const char *from, const char *to)
|
||||||
{
|
{
|
||||||
return INLINE_SYSCALL (linkat, 5, AT_FDCWD, from, AT_FDCWD, to, 0);
|
#ifdef __NR_link
|
||||||
|
return INLINE_SYSCALL_CALL (link, from, to);
|
||||||
|
#else
|
||||||
|
return INLINE_SYSCALL_CALL (linkat, AT_FDCWD, from, AT_FDCWD, to, 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
weak_alias (__link, link)
|
weak_alias (__link, link)
|
Reference in New Issue
Block a user