2
$Id: unxsysc.inc,v 1.5 2004/04/22 16:22:10 marco Exp $
3
This file is part of the Free Pascal run time library.
4
Copyright (c) 2003 Marco van de Voort
5
member of the Free Pascal development team.
7
See the file COPYING.FPC, included in this distribution,
8
for details about the copyright.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY;without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
**********************************************************************}
16
function fpNice(N:cint):cint;
18
Set process priority. A positive N means a lower priority.
19
A negative N decreases priority.
21
Doesn't exist in BSD. Linux emu uses setpriority in a construct as below:
28
prio:=fpgetpriority(PRIO_PROCESS,0);
29
if (prio=-1) and (errno<>0) then
31
fpNice:=fpSetPriority(Prio_Process,0,prio+N);
34
Function fpGetPriority(Which,Who:cint):cint;
36
Get Priority of process, process group, or user.
37
Which : selects what kind of priority is used.
38
can be one of the following predefined Constants :
42
Who : depending on which, this is , respectively :
46
Errors are reported in linuxerror _only_. (priority can be negative)
49
if (which<prio_process) or (which>prio_user) then
51
{ We can save an interrupt here }
53
fpseterrno(ESysEinval);
57
fpGetPriority:=do_syscall(syscall_nr_GetPriority,which,who);
61
Function fpSetPriority(Which,Who,What:cint):cint;
63
Set Priority of process, process group, or user.
64
Which : selects what kind of priority is used.
65
can be one of the following predefined Constants :
69
Who : depending on value of which, this is, respectively :
73
what : A number between -20 and 20. -20 is most favorable, 20 least.
77
if ((which<prio_process) or (which>prio_user)) or ((what<-20) or (what>20)) then
78
fpseterrno(ESyseinval) { We can save an interrupt here }
81
fpSetPriority:=do_syscall(Syscall_nr_Setpriority,which,who,what);
85
Function fpLstat(path:pchar;Info:pstat):cint;
87
Get all information on a link (the link itself), and return it in info.
91
fpLStat:=do_syscall(syscall_nr_lstat,TSysParam(path),TSysParam(info));
94
Function fpLstat(Filename: PathStr;Info:pstat):cint;
96
Get all information on a link (the link itself), and return it in info.
100
FileName:=FileName+#0;
101
fpLStat:=do_syscall(syscall_nr_lstat,TSysParam(@filename[1]),TSysParam(info));
104
Function fpSymlink(oldname,newname:pchar):cint;
106
We need this for erase
110
fpsymlink:=do_syscall(syscall_nr_symlink,TSysParam(oldname),TSysParam(newname));
113
Function fpReadLink(name,linkname:pchar;maxlen:cint):cint;
116
fpreadlink:=do_syscall(syscall_nr_readlink, TSysParam(name),TSysParam(linkname),maxlen);
120
$Log: unxsysc.inc,v $
121
Revision 1.5 2004/04/22 16:22:10 marco
124
Revision 1.4 2004/01/01 17:07:21 marco
125
* few small freebsd fixes backported from debugging linux