29a2c61f9182dedb1fbff6ed3943c00749b6c742
[util-vserver.git] / src / vutil.p
1 // $Id: vutil.p,v 1.3 2003/10/21 13:23:12 ensc Exp $            --*- c++ -*--
2
3 // Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
4 // based on vutil.p by Jacques Gelinas
5 //  
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2, or (at your option)
9 // any later version.
10 //  
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //  
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20
21 /* vutil.cc 11/04/2003 14.22.04 */
22 int file_copy (const char *src, const char *dst, struct stat&st);
23 int setext2flag (const char *fname, bool set, int ext2flags);
24 int vbuild_mkdir (const char *path, mode_t mode);
25 int vbuild_mknod (const char *path, mode_t mode, dev_t dev);
26 int vbuild_symlink (const char *src, const char *dst);
27 int vbuild_link (const char *src, const char *dst);
28 int vbuild_unlink (const char *path);
29 int vbuild_chown (const char *path, uid_t uid, gid_t gid);
30 int vbuild_file_copy (const char *src,
31          const char *dst,
32          struct stat&st);
33 void vutil_loadallpkg (Vserver const &refserver, list<Package>&packages);
34 int vutil_lstat (string path, struct stat&st);
35 FILE *vutil_execdistcmd (const char *key,
36          const string&vserver,
37          const char *args);
38 /* syscall.cc 18/07/2003 09.50.10 */
39 extern "C" int call_new_s_context (int nbctx,
40          int ctxs[],
41          int remove_cap,
42          int flags);
43 extern "C" int call_set_ipv4root (unsigned long ip[],
44          int nb,
45          unsigned long bcast,
46          unsigned long mask[]);
47 extern "C" int call_chrootsafe (const char *dir);
48 extern "C" int has_chrootsafe (void);
49 extern "C" int call_set_ctxlimit (int res, long limit);