fix config file path
[AROS.git] / compiler / clib / umask.c
blob2c2c4d380762f5ad02fb9ec8094bf321e430cc95
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include "__arosc_privdata.h"
8 #include <aros/symbolsets.h>
9 #include <sys/types.h>
10 #include <sys/stat.h>
12 #include LC_LIBDEFS_FILE
14 /*****************************************************************************
16 NAME */
18 mode_t umask(
20 /* SYNOPSIS */
21 mode_t numask)
23 /* FUNCTION
25 INPUTS
27 RESULT
29 NOTES
30 umask is currently remembered but not used in any function
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 ******************************************************************************/
42 struct aroscbase *aroscbase = __aros_getbase_aroscbase();
43 mode_t oumask = aroscbase->acb_umask;
45 aroscbase->acb_umask = numask;
47 return oumask;
50 static int __umask_init(struct aroscbase *aroscbase)
52 struct aroscbase *paroscbase;
54 paroscbase = __GM_GetBaseParent(aroscbase);
56 /* TODO: Implement umask() properly
57 Currently information is not used in any of the related functions
60 /* Child of exec*()/vfork() functions inherit umask of parent */
61 if (paroscbase && (paroscbase->acb_flags & (VFORK_PARENT | EXEC_PARENT)))
62 aroscbase->acb_umask = paroscbase->acb_umask;
63 else
64 aroscbase->acb_umask = S_IWGRP|S_IWOTH;
66 return 1;
69 ADD2OPENLIB(__umask_init, 0);