---
name: "posix_spawnattr_getschedparam"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/posix_spawnattr_getschedparam"
---

# posix\_spawnattr\_getschedparam(3)

get and set the spawn-schedparam attribute of a spawn attributes object

## NAME

**posix\_spawnattr\_getschedparam**, **posix\_spawnattr\_setschedparam** – get and set the spawn-schedparam attribute of a spawn attributes object

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<spawn.h\>**

*int*\

**posix\_spawnattr\_getschedparam**(*const posix\_spawnattr\_t \*restrict attr*, *struct sched\_param \*restrict schedparam*);

*int*\

**posix\_spawnattr\_setschedparam**(*posix\_spawnattr\_t \*attr*, *const struct sched\_param \*restrict schedparam*);

## DESCRIPTION

The **posix\_spawnattr\_getschedparam**() function obtains the value of the spawn-schedparam attribute from the attributes object referenced by *attr*.

The **posix\_spawnattr\_setschedparam**() function sets the spawn-schedparam attribute in an initialized attributes object referenced by *attr*.

The spawn-schedparam attribute represents the scheduling parameters to be assigned to the new process image in a spawn operation (if POSIX\_SPAWN\_SETSCHEDULER or POSIX\_SPAWN\_SETSCHEDPARAM is set in the spawn-flags attribute). The default value of this attribute is unspecified.

## RETURN VALUES

The **posix\_spawnattr\_getschedparam**() and **posix\_spawnattr\_setschedparam**() functions return zero.

## SEE ALSO

[posix\_spawn(3)](/posix_spawn/3.md), [posix\_spawnattr\_destroy(3)](/posix_spawnattr_destroy/3.md), [posix\_spawnattr\_getschedpolicy(3)](/posix_spawnattr_getschedpolicy/3.md), [posix\_spawnattr\_init(3)](/posix_spawnattr_init/3.md), [posix\_spawnattr\_setschedpolicy(3)](/posix_spawnattr_setschedpolicy/3.md), [posix\_spawnp(3)](/posix_spawnp/3.md)

## STANDARDS

The **posix\_spawnattr\_getschedparam**() and **posix\_spawnattr\_setschedparam**() functions conform to IEEE Std 1003.1-2001 (“POSIX.1”).

## HISTORY

The **posix\_spawnattr\_getschedparam**() and **posix\_spawnattr\_setschedparam**() functions first appeared in FreeBSD 8.0.

## AUTHORS

Ed Schouten ⟨*ed@FreeBSD.org*⟩
