aboutsummaryrefslogtreecommitdiff
path: root/gnulib/import/fchown-stub.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-05-29 12:10:38 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-08 00:12:43 -0400
commit64c2e4a530837b13f987f5de386c49bac90aef43 (patch)
tree9f8cbbfd563c4f249f14179e8884d8ae897dd517 /gnulib/import/fchown-stub.c
parente266dea99285eb7c43662ea2a01571dccf00d760 (diff)
downloadbinutils-64c2e4a530837b13f987f5de386c49bac90aef43.zip
binutils-64c2e4a530837b13f987f5de386c49bac90aef43.tar.gz
binutils-64c2e4a530837b13f987f5de386c49bac90aef43.tar.bz2
gnulib: import chown
A few sims use this to emulate chown syscalls.
Diffstat (limited to 'gnulib/import/fchown-stub.c')
-rw-r--r--gnulib/import/fchown-stub.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/gnulib/import/fchown-stub.c b/gnulib/import/fchown-stub.c
new file mode 100644
index 0000000..f549ff3
--- /dev/null
+++ b/gnulib/import/fchown-stub.c
@@ -0,0 +1,34 @@
+/* Change ownership of a file.
+ Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
+
+/* Written by Paul Eggert, 2004. */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <errno.h>
+
+/* A trivial substitute for 'fchown'.
+
+ DJGPP 2.03 and earlier (and perhaps later) don't have 'fchown',
+ so we pretend no-one has permission for this operation. */
+
+int
+fchown (int fd, uid_t uid, gid_t gid)
+{
+ errno = EPERM;
+ return -1;
+}