2
0

linuxnew.inc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt,
  5. BSD parts (c) 2000 by Marco van de Voort
  6. members of the Free Pascal development team.
  7. New linux unit. Linux only calls only. Will be renamed to linux.pp
  8. when 1.0.x support is killed off.
  9. See the file COPYING.FPC, included in this distribution,
  10. 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.
  14. **********************************************************************}
  15. unit Linux;
  16. interface
  17. Type
  18. TSysinfo = packed record
  19. uptime : longint;
  20. loads : array[1..3] of longint;
  21. totalram,
  22. freeram,
  23. sharedram,
  24. bufferram,
  25. totalswap,
  26. freeswap : longint;
  27. procs : integer;
  28. s : string[18];
  29. end;
  30. PSysInfo = ^TSysInfo;
  31. Function Sysinfo(var Info:TSysinfo):Boolean;
  32. implementation
  33. Uses Syscall;
  34. Function Sysinfo(var Info:TSysinfo):Boolean;
  35. {
  36. Get system info
  37. }
  38. Begin
  39. Sysinfo:=do_SysCall(SysCall_nr_Sysinfo,longint(@info))=0;
  40. End;
  41. end.
  42. {
  43. $Log$
  44. Revision 1.2 2003-09-15 20:08:49 marco
  45. * small fixes. FreeBSD now cycles
  46. Revision 1.1 2003/09/15 14:12:17 marco
  47. * moved linux.pp contents to linuxold etc
  48. }