Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac: vfork #23

Open
adamyg opened this issue Jul 12, 2022 · 1 comment
Open

Mac: vfork #23

adamyg opened this issue Jul 12, 2022 · 1 comment
Labels
upgrade Update/upstream merge

Comments

@adamyg
Copy link
Owner

adamyg commented Jul 12, 2022

'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]

   #define  _GNU_SOURCE /*top*/
   #if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__) /* force USEVFORK on GNU libc */
	flags |= POSIX_SPAWN_USEVFORK;
   #endif
   	posix_spawn_file_actions_t fops;
	posix_spawnattr_t attr;
	sigset_t mask;
	
   	posixspawn_file_actions_init(&fops, options);
	posix_spawnattr_init(&attr);
	flags |= POSIX_SPAWN_SETSIGMASK; /* child does not block any signals */
	sigemptyset(&mask);
	posix_spawnattr_setsigmask(&attr, &mask);
	flags |= POSIX_SPAWN_SETSIGDEF;  /* child reverts SIGPIPE handler to the default. */
	sigaddset(&mask, SIGPIPE);
	posix_spawnattr_setsigdefault(&attr, &mask);  
        posixspawn_set_pgroup(options, &attr, &flags);
        posix_spawnattr_setflags(&attr, flags);    
            posix_spawnp(&pid, file, &fops, &attr, argv, envp ? envp : environ /*global*/);
                 chdir(cwd)  [optional]
        posix_spawn_file_actions_destroy(&fops);
        posix_spawnattr_destroy(&attr); 
@adamyg
Copy link
Owner Author

adamyg commented May 28, 2024

also replace mktemp()

@adamyg adamyg added the upgrade Update/upstream merge label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upgrade Update/upstream merge
Projects
None yet
Development

No branches or pull requests

1 participant