Recent

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

abdoun.brahim

  • New member
  • *
  • Posts: 9
equivalent setpgrp() in lazarus
« on: May 11, 2022, 07:16:47 pm »
Hello
What is the equivalent of the setpgrp() command of the C in lazarus language

MarkMLl

  • Hero Member
  • *****
  • Posts: 5127
Re: equivalent setpgrp() in lazarus
« Reply #1 on: May 12, 2022, 09:58:23 am »
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
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: 11897
Re: equivalent setpgrp() in lazarus
« Reply #2 on: May 12, 2022, 12:49:55 pm »
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.
« Last Edit: May 12, 2022, 01:05:17 pm by Thaddy »
Black themes should be banned.

abdoun.brahim

  • New member
  • *
  • Posts: 9
Re: equivalent setpgrp() in lazarus
« Reply #3 on: May 12, 2022, 01:41:43 pm »
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

  • Administrator
  • Hero Member
  • *
  • Posts: 10277
  • FPC developer.
Re: equivalent setpgrp() in lazarus
« Reply #4 on: May 12, 2022, 01:53:32 pm »
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

  • Hero Member
  • *****
  • Posts: 5127
Re: equivalent setpgrp() in lazarus
« Reply #5 on: May 12, 2022, 02:20:15 pm »
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
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

Thausand

  • Sr. Member
  • ****
  • Posts: 291
Re: equivalent setpgrp() in lazarus
« Reply #6 on: May 12, 2022, 02:30:19 pm »

MarkMLl

  • Hero Member
  • *****
  • Posts: 5127
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

abdoun.brahim

  • New member
  • *
  • Posts: 9
Re: equivalent setpgrp() in lazarus
« Reply #8 on: May 12, 2022, 04:19:22 pm »
i foud it in unite :termio

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 10277
  • FPC developer.
Re: equivalent setpgrp() in lazarus
« Reply #9 on: May 12, 2022, 04:46:55 pm »
If I understand the man page clearly, it is a BSD call that was adapted by Linux, but never standarized under POSIX.

MarkMLl

  • Hero Member
  • *****
  • Posts: 5127
Re: equivalent setpgrp() in lazarus
« Reply #10 on: May 12, 2022, 05:06:50 pm »
If 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
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: 11897
Re: equivalent setpgrp() in lazarus
« Reply #11 on: May 13, 2022, 03:41:58 pm »
If 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.
Black themes should be banned.

MarkMLl

  • Hero Member
  • *****
  • Posts: 5127
Re: equivalent setpgrp() in lazarus
« Reply #12 on: May 13, 2022, 04:14:13 pm »
If 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
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: 11897
Re: equivalent setpgrp() in lazarus
« Reply #13 on: May 13, 2022, 06:57:18 pm »
BSD dates from 1993, Netware dates from 1983....Unix relase dates from 1970... That call was introduced by Novell.
« Last Edit: May 13, 2022, 06:58:50 pm by Thaddy »
Black themes should be banned.

MarkMLl

  • Hero Member
  • *****
  • Posts: 5127
Re: equivalent setpgrp() in lazarus
« Reply #14 on: May 13, 2022, 07:08:40 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).

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