xref: /netbsd-src/external/gpl3/gdb/dist/gnulib/import/fchown-stub.c (revision 4b169a6ba595ae283ca507b26b15fdff40495b1c)
1*4b169a6bSchristos /* Change ownership of a file.
2*4b169a6bSchristos    Copyright (C) 2004-2022 Free Software Foundation, Inc.
3*4b169a6bSchristos 
4*4b169a6bSchristos    This file is free software: you can redistribute it and/or modify
5*4b169a6bSchristos    it under the terms of the GNU Lesser General Public License as
6*4b169a6bSchristos    published by the Free Software Foundation; either version 2.1 of the
7*4b169a6bSchristos    License, or (at your option) any later version.
8*4b169a6bSchristos 
9*4b169a6bSchristos    This file is distributed in the hope that it will be useful,
10*4b169a6bSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*4b169a6bSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*4b169a6bSchristos    GNU Lesser General Public License for more details.
13*4b169a6bSchristos 
14*4b169a6bSchristos    You should have received a copy of the GNU Lesser General Public License
15*4b169a6bSchristos    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
16*4b169a6bSchristos 
17*4b169a6bSchristos /* Written by Paul Eggert, 2004.  */
18*4b169a6bSchristos 
19*4b169a6bSchristos #include <config.h>
20*4b169a6bSchristos 
21*4b169a6bSchristos #include <sys/types.h>
22*4b169a6bSchristos #include <errno.h>
23*4b169a6bSchristos 
24*4b169a6bSchristos /* A trivial substitute for 'fchown'.
25*4b169a6bSchristos 
26*4b169a6bSchristos    DJGPP 2.03 and earlier (and perhaps later) don't have 'fchown',
27*4b169a6bSchristos    so we pretend no-one has permission for this operation. */
28*4b169a6bSchristos 
29*4b169a6bSchristos int
fchown(int fd,uid_t uid,gid_t gid)30*4b169a6bSchristos fchown (int fd, uid_t uid, gid_t gid)
31*4b169a6bSchristos {
32*4b169a6bSchristos   errno = EPERM;
33*4b169a6bSchristos   return -1;
34*4b169a6bSchristos }
35