Project

General

Profile

Actions

Feature #116

closed
WA WA

Port the process code

Feature #116: Port the process code

Added by walkero 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
01/31/2026
Due date:
% Done:

100%

Estimated time:

Description

There is a part of the editor that is about launching different processes. That will help with plugins. This is using pipe() and fork(), things that do not exist in newlib, but some of them exist in clib4.

The first approach should be to use clib4 for the port, and change the missing functions with something that exists and works.
If the above doesn't work I need to do my own implementation, which should be based on OS4 API.

It is needed to do a research what should be used on MorphOS and what actually exists there. This might require a different approach, which might define what should be done with the OS4 port as well.

WA Updated by walkero 5 months ago Actions #1

if process is compiled with newlib I get the following errors

src/api/process.c: In function ‘process_start’:
src/api/process.c:507:11: error: implicit declaration of function ‘pipe’ [-Werror=implicit-function-declaration]
  507 |       if (pipe(self->child_pipes[i]) || fcntl(self->child_pipes[i][i == STDIN_FD ? 1 : 0], F_SETFL, O_NONBLOCK) == -1) {
      |           ^~~~
src/api/process.c:525:23: error: implicit declaration of function ‘fork’ [-Werror=implicit-function-declaration]
  525 |     self->pid = (long)fork();
      |                       ^~~~
src/api/process.c:533:9: error: implicit declaration of function ‘setpgid’; did you mean ‘setgid’? [-Werror=implicit-function-declaration]
  533 |         setpgid(0,0);
      |         ^~~~~~~
      |         setgid
src/api/process.c:552:9: error: implicit declaration of function ‘execvp’ [-Werror=implicit-function-declaration]
  552 |         execvp(cmd[0], (char** const) cmd);

with clib4 I get the following

src/api/process.c: In function ‘process_start’:
src/api/process.c:525:23: error: implicit declaration of function ‘fork’ [-Werror=implicit-function-declaration]
  525 |     self->pid = (long)fork();
      |                       ^~~~
src/api/process.c:533:9: error: implicit declaration of function ‘setpgid’; did you mean ‘setgid’? [-Werror=implicit-function-declaration]
  533 |         setpgid(0,0);
      |         ^~~~~~~
      |         setgid

WA Updated by walkero 5 months ago Actions #2

  • % Done changed from 0 to 100

WA Updated by walkero 5 months ago Actions #3

  • Target version changed from backlog to 3.8.2

WA Updated by walkero 5 months ago Actions #4

  • Status changed from New to Closed
Actions

Also available in: PDF Atom