2
$Id: unxsysc.inc,v 1.5 2004/04/22 17:17:23 peter Exp $
3
This file is part of the Free Pascal run time library.
4
Copyright (c) 2001 by Free Pascal development team
6
Some calls for the unix unit.
8
See the file COPYING.FPC, included in this distribution,
9
for details about the copyright.
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.
15
***********************************************************************}
17
function fpNice(N:cint):cint;
19
Set process priority. A positive N means a lower priority.
20
A negative N increases priority.
22
Doesn't exist in BSD. Linux emu uses setpriority in a construct as below:
31
oldprio:=fpGetPriority(Prio_Process,0);
32
fpNice:=fpSetPriority(Prio_Process,0,oldprio+N);
34
fpNice:=fpGetPriority(Prio_Process,0);
36
fpNice:=do_syscall(Syscall_nr_nice,N);
40
Function fpGetPriority(Which,Who:cint):cint;
42
Get Priority of process, process group, or user.
43
Which : selects what kind of priority is used.
44
can be one of the following predefined Constants :
48
Who : depending on which, this is , respectively :
52
Errors are reported in linuxerror _only_. (priority can be negative)
55
if (which<prio_process) or (which>prio_user) then
57
{ We can save an interrupt here }
59
fpsetErrno(ESysEinval);
62
fpGetPriority:=do_syscall(syscall_nr_GetPriority,which,who);
65
Function fpSetPriority(Which,Who,What:cint):cint;
67
Set Priority of process, process group, or user.
68
Which : selects what kind of priority is used.
69
can be one of the following predefined Constants :
73
Who : depending on value of which, this is, respectively :
77
what : A number between -20 and 20. -20 is most favorable, 20 least.
81
if ((which<prio_process) or (which>prio_user)) or ((what<-20) or (what>20)) then
82
fpseterrno(ESyseinval) { We can save an interrupt here }
85
fpSetPriority:=do_syscall(Syscall_nr_Setpriority,which,who,what);
89
Function fpLstat(path:pchar;Info:pstat):cint;
91
Get all information on a link (the link itself), and return it in info.
95
fpLStat:=do_syscall(syscall_nr_lstat,TSysParam(path),TSysParam(info));
98
Function fpLstat(Filename: PathStr;Info:pstat):cint;
100
Get all information on a link (the link itself), and return it in info.
104
FileName:=FileName+#0;
105
fpLStat:=do_syscall(syscall_nr_lstat,TSysParam(@filename[1]),TSysParam(info));
108
Function fpSymlink(oldname,newname:pchar):cint;
110
We need this for erase
114
fpsymlink:=do_syscall(syscall_nr_symlink,TSysParam(oldname),TSysParam(newname));
118
$Log: unxsysc.inc,v $
119
Revision 1.5 2004/04/22 17:17:23 peter
122
Revision 1.4 2004/01/01 16:10:23 marco
123
* fpreadlink(pathstr) moved to unxovl (since not platform specific),
124
small fixes for "make all OPT='-dFPC_USE_LIBC'
126
Revision 1.3 2003/11/13 13:11:55 marco
127
* Linuxerror remove + hdr+log added
b'\\ No newline at end of file'