Recent

Author Topic: equivalent setpgrp() in lazarus  (Read 3277 times)

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: equivalent setpgrp() in lazarus
« Reply #15 on: May 13, 2022, 10:40:43 pm »
And ASCII was introduced by IBM.

I don't care who introduced it: it's supported by Linux and that manpage cites POSIX.1 (with non-standard variations for SysV and BSD).

But not for that call afaik. For other calls on that manpage.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: equivalent setpgrp() in lazarus
« Reply #16 on: May 13, 2022, 11:00:32 pm »
Hmmm. man setpgrp ->

Quote
DESCRIPTION
       All  of these interfaces are available on Linux, and are used for getting and setting the process group ID (PGID) of a process.  The
       preferred, POSIX.1-specified ways of doing this are: getpgrp(void), for retrieving the calling process's PGID;  and  setpgid(),  for
       setting a process's PGID.

and

Quote
The System V-style setpgrp(), which takes no arguments, is equivalent to setpgid(0, 0).

       The BSD-specific setpgrp() call, which takes arguments pid and pgid, is a wrapper function that calls

           setpgid(pid, pgid)

       Since glibc 2.19, the BSD-specific setpgrp() function is no longer  exposed  by  <unistd.h>;  calls  should  be  replaced  with  the
       setpgid() call shown above.

Also in ./rtl/linux/x86_64/sysnr.inc:

Code: Pascal  [Select][+][-]
  1.   syscall_nr_setpgid                           = 109;
  2.   syscall_nr_getppid                           = 110;
  3.   syscall_nr_getpgrp                           = 111;
  4. ...
  5.   syscall_nr_getpgid                           = 121;
  6.  

It looks as though the Netware RTL is the only one to implement FpSetpgid(), which might in practice be what OP's looking for.

MarkMLl
« Last Edit: May 13, 2022, 11:16:04 pm by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: equivalent setpgrp() in lazarus
« Reply #17 on: May 13, 2022, 11:12:47 pm »
From my debian manpage:

Quote
POSIX.1-2001 also specifies getpgid() and the version of setpgrp() that takes no arguments.  (POSIX.1-2008 marks  this  setpgrp()
       specification as obsolete.)

       The  version of getpgrp() with one argument and the version of setpgrp() that takes two arguments derive from 4.2BSD, and are not
       specified by POSIX.1.

So no parameter version of setpgrp was shortly specified and then obsoleted, and the 2 argument version (which this thread is about) never was standarized

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: equivalent setpgrp() in lazarus
« Reply #18 on: May 13, 2022, 11:29:49 pm »
So no parameter version of setpgrp was shortly specified and then obsoleted, and the 2 argument version (which this thread is about) never was standarized

I don't think OP specifies the number of parameters. In any event, there appear to be Linux syscalls that can't be easily accessed other than by going via the termios stuff (which, TBH, is probably functionally adequate).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: equivalent setpgrp() in lazarus
« Reply #19 on: May 14, 2022, 02:29:46 pm »
It looks as though the Netware RTL is the only one to implement FpSetpgid(), which might in practice be what OP's looking for.

MarkMLl
Yes. Correct. Grep will tell you so too... (I am repeating myself).
Now playing The Hyves again. https://www.youtube.com/watch?v=Uz1Jwyxd4tE Useful song..
« Last Edit: May 14, 2022, 02:37:02 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: equivalent setpgrp() in lazarus
« Reply #20 on: May 14, 2022, 03:36:51 pm »
Yes. Correct. Grep will tell you so too... (I am repeating myself).

Yes, I found it via grep. But what he /should/ be looking for is setpgid(), which is unimplemented.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: equivalent setpgrp() in lazarus
« Reply #21 on: May 15, 2022, 12:46:16 am »
[Yes, I found it via grep. But what he /should/ be looking for is setpgid(), which is unimplemented.

MarkMLl
That should be fpsetpgid()...
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: equivalent setpgrp() in lazarus
« Reply #22 on: May 15, 2022, 09:05:54 am »
That should be fpsetpgid()...

Agreed, from the POV of FPC naming.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018