From 64c2e4a530837b13f987f5de386c49bac90aef43 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 29 May 2021 12:10:38 -0400 Subject: gnulib: import chown A few sims use this to emulate chown syscalls. --- gnulib/import/fchown-stub.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 gnulib/import/fchown-stub.c (limited to 'gnulib/import/fchown-stub.c') 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 . */ + +/* Written by Paul Eggert, 2004. */ + +#include + +#include +#include + +/* 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; +} -- cgit v1.1