# FreeBSD API documentation



## SR_Ind (Oct 2, 2012)

Is there a FreeBSD API documentation somewhere?


----------



## trasz@ (Oct 3, 2012)

Yes.  Please see manual pages in section 2 (syscalls) and 3 (library calls); they live in /usr/share/man/man2 and /usr/share/man/man3, respectively.


----------



## SR_Ind (Oct 3, 2012)

Thanks. This is what I was looking for.


----------



## fender0107401 (Oct 3, 2012)

SR_Ind said:
			
		

> Thanks. This is what I was looking for.



Check APUE.


----------



## SR_Ind (Oct 4, 2012)

The APUE tarball seems interesting. But I don't see some interesting parts. Sound API for example. Where do I find the API's for network interface?

@trasz@ - I took an overview of the man pages. It looked promising to begin with. 

I guess I'm looking for something else. 

Assume I want to know all the system calls to the sound sub-system. Is there a place that list all the functions and a mention of the related header file and link library names?


----------



## Flogo (Dec 1, 2012)

Hi !



			
				SR_Ind said:
			
		

> The APUE tarball seems interesting. But I don't see some interesting parts. Sound API for example. Where do I find the API's for network interface?
> [...]
> Assume I want to know all the system calls to the sound sub-system. Is there a place that list all the functions and a mention of the related header file and link library names?



SR_Ind, I'm also interested to learn how to use the API. Here is what I found:

- A good example to get information on network interface: http://www.lemoda.net/freebsd/net-interfaces/index.html

- About the sound API, give a look to the man sound(4) in the section "_Runtime Configuration_" you got the _sysctl_ variables, now you can check here: man sysctl(3)

I hope it helps you !

Flogo


----------



## trasz@ (Dec 1, 2012)

The low level API for sound used in FreeBSD is called OSS; you can find programing manual e.g. here: http://www.4front-tech.com/pguide/index.html.  You might want to use some higher-level API instead, such as PulseAudio or JACK.


----------



## TonyMeteo (Jan 2, 2017)

trasz@ said:


> Yes.  Please see manual pages in section 2 (syscalls) and 3 (library calls); they live in /usr/share/man/man2 and /usr/share/man/man3, respectively.


I t


trasz@ said:


> Yes.  Please see manual pages in section 2 (syscalls) and 3 (library calls); they live in /usr/share/man/man2 and /usr/share/man/man3, respectively.


Can you explain how to do that? i can't seem to find anything about syscalls with 'man syscall' which merely describe the function ,plus library calls manual live in /usr/share/man/man3 ? how to read it? there are only there. Is there a documentation (like the ones in 'en-freebsd-doc' package ? 
thks


----------



## fnoyanisi (Jan 2, 2017)

SR_Ind said:


> Is there a FreeBSD API documentation somewhere?


SR_Ind, you may find Developers' Handook useful. Also, you can find a list of available system calls in syscall.h .


```
less /usr/include/sys/syscall.h
```



SR_Ind said:


> Where do I find the API's for network interface?


SR_Ind, check netintro(4) for the implementation of network layer. Also, you may want to have a bit of ifconfig(8) source code reading to see some code examples. You will see that rather than having a high level API, many things are implemented as ioctl(2) calls to NIC driver.



TonyMeteo said:


> Can you explain how to do that? i can't seem to find anything about syscalls with 'man syscall' which merely describe the function


TonyMeteo , this link explains what a syscall is. Also, intro(2) manual page is a good starting point before diving into details.



TonyMeteo said:


> plus library calls manual live in /usr/share/man/man3 ? how to read it? there are only there


I am sure you know what man(1) and apropos(1) commands are?



TonyMeteo said:


> Is there a documentation (like the ones in 'en-freebsd-doc' package ?


See my reply to SR_Ind above.


----------

