Skip to content

Export CGid from System.Process.Internals (especially on Windows) #90

@RyanGlScott

Description

@RyanGlScott

I found myself wanting to derive some instances for CreateProcess in one of my applications recently, only to discover that it wouldn't work on Windows. Why? Because CreateProcess uses UserID and GroupID fields, the definitions of which are platform-dependent:

#ifdef WINDOWS
-- Define some missing types for Windows compatibility. Note that these values
-- will never actually be used, as the setuid/setgid system calls are not
-- applicable on Windows. No value of this type will ever exist.
newtype CGid = CGid Word32
  deriving (Show, Eq)
type GroupID = CGid
type UserID = CGid
#else
type PHANDLE = CPid
#endif

This Windows-only newtype CGid is only available in the internal System.Process.Common module, and as a result, I can't make any instances for it (and thus can't derive any instances for CreateProcess).

Would you consider reexporting CGid from System.Process.Internals? That way I could accomplish my original goal, and process wouldn't have to make any API promises about the design of CGid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions