WSL icon indicating copy to clipboard operation
WSL copied to clipboard

signalfd() not fully supported?

Open mit-mit opened this issue 10 years ago • 14 comments

To what extent is signalfd() supported? Are only some masks supported?

The following code snippet seems to fail with signalfd failed: Invalid argument

...
 int fd = signalfd(-1, &signal_mask, SFD_CLOEXEC);
  if (fd == -1) {
    FATAL1("signalfd failed: %s", strerror(errno));
  }
...

mit-mit avatar Apr 11 '16 13:04 mit-mit

Thanks for trying this out. 'signalfd' syscall is not yet implemented in WSL. No ETA at this time. We are looking at getting the (un)implemented syscall list documented somewhere. Stay tuned!

sunilmut avatar Apr 12 '16 20:04 sunilmut

Is this considered a 'bug' or a 'feature' per the categories descrived in readme.md?

mit-mit avatar Apr 26 '16 06:04 mit-mit

@sunilmut would appreciate a quick response on my question above.

mit-mit avatar May 19 '16 10:05 mit-mit

@mit-mit - Apologize for the delay. As per the readme "feature – Denotes something that is not yet implemented", this would be considered as a feature. Do help us prioritize it by providing the feedback a the User Voice Page.

sunilmut avatar May 19 '16 17:05 sunilmut

Well signalfd is completely implemented since Linux 2.6.27 kernel released 9 October 2008 and is used in recent util-linux 2.27 that ships in Ubuntu 16.04. So I guess you will soon want to upgrade that from feature request to a bug to fix...

xilun avatar May 20 '16 20:05 xilun

@xilun The distinction is largely arbitrary for us. I think what @sunilmut means is that if it's broken functionality in something WSL implements, it's a bug. If it's new surface area (like inotify or signalfd) it'd be a feature.

Regardless if it's a bug or a feature it's something that needs to be fixed eventually.

benhillis avatar May 20 '16 20:05 benhillis

Ok no problem about the way you handle all that, prioritize your work and so over. Was just saying that because I just checked on https://codesearch.debian.net/ and saw that the command "script" in linux-util 2.27 uses signalfd, and I thought that I would be quite sad if I can't use that basic Unix command the day I need it...

Well, I also secretly want to use it in cbwin but if its lack break Ubuntu 16.04 compat I guess it a rather more convincing incentive to get it implemented quickly ;)

xilun avatar May 20 '16 21:05 xilun

I've posted the 'issue' as an idea here: https://wpdev.uservoice.com/forums/266908-command-prompt-console-bash-on-ubuntu-on-windo/suggestions/17230763-implementing-signalfd-syscall-in-wsl.

Yamazakin avatar Nov 24 '16 14:11 Yamazakin

Hey, just wanted to leave me here, as I can't run my own code (w/o modification), as I depend on signalfd(), too.

That's how I call it: fd_ = signalfd(-1, &signalMask_, SFD_NONBLOCK | SFD_CLOEXEC); and fd results in -1 with ENOSYS.

Hope to hear from you soon. :+1:

christianparpart avatar Mar 16 '17 00:03 christianparpart

+1 Trying to run Cap’n Proto (similar to Protocol Buffers) under WSL and it doesn't fully work because of signalfd(). See https://github.com/sandstorm-io/capnproto/issues/458

realuser avatar Apr 25 '17 21:04 realuser

+1 Cannot run Microsoft's IoT Edge.

robert4os avatar Oct 21 '17 21:10 robert4os

+1 Cannot start LXC containers without signalfd()

# lxc start my-container
error: Error calling 'lxd forkstart my-container /var/lib/lxd/containers /var/log/lxd/my-container/lxc.conf': err='Failed to run: /usr/bin/lxd forkstart my-container /var/lib/lxd/containers /var/log/lxd/my-container/lxc.conf: '
  lxc 20171117211111.458 ERROR lxc_start - start.c:setup_signal_fd:263 - Function not implemented - Failed to create signal file descriptor.
  lxc 20171117211111.458 ERROR lxc_start - start.c:lxc_init:460 - Failed to setup SIGCHLD fd handler.
  lxc 20171117211111.458 ERROR lxc_start - start.c:__lxc_start:1314 - Failed to initialize container "my-container".

Upvoted on User Voice 😉

Julien-Marcou avatar Nov 17 '17 21:11 Julien-Marcou

Hello, I also need to use signalfd() in a large number of applications that I have developed. It seems that the feature/bug has not been solved yet. do you have any new information about this topic ?

jerybe avatar Nov 22 '17 10:11 jerybe

This should be resolved as of Insiders Build 17101.

Brian-Perkins avatar Feb 15 '18 01:02 Brian-Perkins