equivalent setpgrp() in lazarus lazarus / 66-Unix ---------------------------------------------------------------------- abdoun.brahim · 2022-05-11 17:16 Hello What is the equivalent of the setpgrp() command of the C in lazarus language ---------------------------------------------------------------------- MarkMLl · 2022-05-12 07:58 Note that this is nothing to do with C, it's a unix syscall. Also it's not really anything to do with the Lazarus IDE or the LCL, it's an underlying FPC library issue. I don't think it's implemented. I can see the syscall number in the sources, but you might need to either import clib or user TCSetPGrp() from termios. MarkMLl ---------------------------------------------------------------------- Thaddy · 2022-05-12 10:49 If it is implemented - I am not sure it is - it has an fp prefix since a couple of versions, so fpsetpgrp.. [edit] it is implemented, but maybe not for all platforms. I found it at least in /rtl/netwlibc/libc.pp using grep. I can't imagine you really want to use netware/nlm, btw. But that is the only one that matched: seems tied to netware libc, not C. ---------------------------------------------------------------------- abdoun.brahim · 2022-05-12 11:41 Thank you for your help when I compile I have the error using fpSetPGrp error:identifier not found "fpsetpgrp" when I compile I have the error using tcSetPGrp error:identifier not found "tcsetpgrp" ---------------------------------------------------------------------- marcov · 2022-05-12 11:53 Possibly the setgroups() in the "grp" unit is doing the same. Like some other Unix user and group functions, these are in the "user" package and link to libc. ---------------------------------------------------------------------- MarkMLl · 2022-05-12 12:20 Where's that package documented? I can't find it in any of the pages cited at https://www.freepascal.org/docs.html Following through to libc stuff, setgroups() is described as "sets the supplementary group IDs for the calling process" which I suspect is not what OP's looking for. MarkMLl ---------------------------------------------------------------------- Thausand · 2022-05-12 12:30 Is it not same like fpSetGid (https://www.freepascal.org/docs- html/rtl/baseunix/fpsetgid.html) ? ---------------------------------------------------------------------- MarkMLl · 2022-05-12 12:38 Quote from: Thausand on May 12, 2022, 02:30:19 pmIs it not same like fpSetGid (https://www.freepascal.org/docs- html/rtl/baseunix/fpsetgid.html) ? No. MarkMLl ---------------------------------------------------------------------- abdoun.brahim · 2022-05-12 14:19 i foud it in unite :termio ---------------------------------------------------------------------- marcov · 2022-05-12 14:46 If I understand the man page clearly, it is a BSD call that was adapted by Linux, but never standarized under POSIX. ---------------------------------------------------------------------- MarkMLl · 2022-05-12 15:06 Quote from: marcov on May 12, 2022, 04:46:55 pmIf I understand the man page clearly, it is a BSD call that was adapted by Linux, but never standarized under POSIX. So presumably at least one of the popular gettys is used by both Linux and the BSDs, which is why it's in termio. MarkMLl ---------------------------------------------------------------------- Thaddy · 2022-05-13 13:41 Quote from: marcov on May 12, 2022, 04:46:55 pmIf I understand the man page clearly, it is a BSD call that was adapted by Linux, but never standarized under POSIX. No it is a netware call. Indeed not standard. ---------------------------------------------------------------------- MarkMLl · 2022-05-13 14:14 Quote from: Thaddy on May 13, 2022, 03:41:58 pmQuote from: marcov on May 12, 2022, 04:46:55 pmIf I understand the man page clearly, it is a BSD call that was adapted by Linux, but never standarized under POSIX. No it is a netware call. Indeed not standard. "Up to a point Lord Copper." https://linux.die.net/man/2/setpgrp MarkMLl ---------------------------------------------------------------------- Thaddy · 2022-05-13 16:57 BSD dates from 1993, Netware dates from 1983....Unix relase dates from 1970... That call was introduced by Novell. ---------------------------------------------------------------------- MarkMLl · 2022-05-13 17:08 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). MarkMLl ---------------------------------------------------------------------- marcov · 2022-05-13 20:40 Quote from: MarkMLl on May 13, 2022, 07:08:40 pmAnd 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 · 2022-05-13 21:00 Hmmm. man setpgrp -> QuoteDESCRIPTION        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 QuoteThe 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  ;  calls  should  be  replaced  with  the        setpgid() call shown above. Also in ./rtl/linux/x86_64/sysnr.inc: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   syscall_nr_setpgid                           = 109;  syscall_nr_getppid                           = 110;  syscall_nr_getpgrp                           = 111;...  syscall_nr_getpgid                           = 121;  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 ---------------------------------------------------------------------- marcov · 2022-05-13 21:12 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 · 2022-05-13 21:29 Quote from: marcov on May 13, 2022, 11:12:47 pmSo 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 ---------------------------------------------------------------------- Thaddy · 2022-05-14 12:29 Quote from: MarkMLl on May 13, 2022, 11:00:32 pmIt 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.. ---------------------------------------------------------------------- MarkMLl · 2022-05-14 13:36 Quote from: Thaddy on May 14, 2022, 02:29:46 pmYes. 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 ---------------------------------------------------------------------- Thaddy · 2022-05-14 22:46 Quote from: MarkMLl on May 14, 2022, 03:36:51 pm[Yes, I found it via grep. But what he /should/ be looking for is setpgid(), which is unimplemented. MarkMLl That should be fpsetpgid()... ---------------------------------------------------------------------- MarkMLl · 2022-05-15 07:05 Quote from: Thaddy on May 15, 2022, 12:46:16 amThat should be fpsetpgid()... Agreed, from the POV of FPC naming. MarkMLl