summaryrefslogtreecommitdiffstats
path: root/libc/misc/file/lockf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/file/lockf.c')
-rw-r--r--libc/misc/file/lockf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libc/misc/file/lockf.c b/libc/misc/file/lockf.c
index 29c91482a..2ba81de9a 100644
--- a/libc/misc/file/lockf.c
+++ b/libc/misc/file/lockf.c
@@ -16,6 +16,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <features.h>
+#undef __lockf
+
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
@@ -24,7 +27,8 @@
/* lockf is a simplified interface to fcntl's locking facilities. */
-int lockf (int fd, int cmd, off_t len)
+#undef lockf
+int attribute_hidden __lockf (int fd, int cmd, off_t len)
{
struct flock fl;
@@ -41,7 +45,7 @@ int lockf (int fd, int cmd, off_t len)
/* Test the lock: return 0 if FD is unlocked or locked by this process;
return -1, set errno to EACCES, if another process holds the lock. */
fl.l_type = F_RDLCK;
- if (fcntl (fd, F_GETLK, &fl) < 0)
+ if (__fcntl (fd, F_GETLK, &fl) < 0)
return -1;
if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
return 0;
@@ -66,5 +70,6 @@ int lockf (int fd, int cmd, off_t len)
return -1;
}
- return fcntl(fd, cmd, &fl);
+ return __fcntl(fd, cmd, &fl);
}
+strong_alias(__lockf,lockf)