# /usr/include/machine/procctl.h is missing



## rwmj (Jul 28, 2022)

I'm trying to use `#include <sys/procctl.h>`.  But this header includes `machine/procctl.h` and that header is not present on my FreeBSD 12.3 system.  I'm fairly certain that I didn't delete that file.  How am I meant to get the `machine/procctl.h` file?


----------



## SirDice (Jul 28, 2022)

File doesn't contain much, here is my copy:

```
/*-
 * This file is in the public domain.
 */
/* $FreeBSD$ */

#include <x86/procctl.h>
```


----------



## rwmj (Jul 28, 2022)

I don't have `/usr/include/x86/procctl.h` either.

pkg-provides suggests installing `amd64-freebsd-sysroot`, which I did, but that seems to only provide a cross-compiler file (`usr/local/freebsd-sysroot/amd64/usr/include/machine/procctl.h` etc)


----------



## SirDice (Jul 28, 2022)

These files are part of the base OS, there are no packages for it.


----------



## _martin (Jul 28, 2022)

You should be using what man page says, `sys/procctl.h` and not care about much else. I did a quick test program on 12.3:

```
#include <stdio.h>
#include <sys/procctl.h>
#include <unistd.h>

int main() {
        pid_t pid = getpid();

        int data = PROC_ASLR_FORCE_ENABLE;

        if ((procctl(P_PID, pid, PROC_ASLR_CTL, &data)) == -1) {
                perror("procctl");
                return 1;
        }
        return 0;
}
```
and it is working as expected.
However I do have /usr/include/machine/procctl.h. Depending on your installation it comes either from `base.txz` or from git installation. (edit: so as SirDice pointed out, it's part of the base).


----------

