Skip to content

Changes required for Windows support

wez edited this page Nov 2, 2014 · 6 revisions

If you're interested in working on Windows support, here's a partial list of things you'll need to do:

  • Use Windows file-watching APIs: ReadDirectoryChangesW
  • Translation layer to convert internal UTF-8 to UTF-16 and back, for Win32 syscalls
  • Replacement for fork/exec in daemonize()
  • Using the Win32 threading API instead of pthreads
  • Translation layer switching forward slashes to backslashes and back, for Win32 syscalls (maybe?)
  • Either use Windows socket APIs or ensure Winsock works. Specifically: Watchman currently exclusively uses unix sockets to create a well-known endpoint on a per-user basis. Windows doesn't support unix domain sockets. The closest equivalent is the named pipe which doesn't really behave the same way at all, but has similar characteristics. Another option is use TCP sockets and bind to the loopback. This is more appealing because more portable tools know how to talk to TCP sockets than NT named pipes. The drawback is that having a well-known port works great only for single-user scenarios.
Clone this wiki locally