Is it possible to access the original argv
pointer from within a Haskell main
?
My use case is that I'd like to remove command-line parameters after the application has started so they can't be read via ps
. There are a few ways to do this but all require manipulating the originalargv
.
I am able to do this if I write a C wrapper and call hs_init
from there (afterwards mucking around with argv
ala here), but it'd be nicer to do this from Haskell.
Thanks!
PS - this question is different from the duplicate as the duplicate uses a prctl
which, as far as I can tell, only lets you change the process name. Further, the duplicate is looking to "set" argv[0]
whereas I am trying to obtain a mutable reference to the original argv
used to call the program.