| 1796 | } |
| 1797 | |
| 1798 | static int |
| 1799 | proc_read_string(struct thread *td, struct proc *p, const char *sptr, char *buf, |
| 1800 | size_t len) |
| 1801 | { |
| 1802 | ssize_t n; |
| 1803 | |
| 1804 | /* |
| 1805 | * This may return a short read if the string is shorter than the chunk |
| 1806 | * and is aligned at the end of the page, and the following page is not |
| 1807 | * mapped. |
| 1808 | */ |
| 1809 | n = proc_readmem(td, p, (vm_offset_t)sptr, buf, len); |
| 1810 | if (n <= 0) |
| 1811 | return (ENOMEM); |
| 1812 | return (0); |
| 1813 | } |
| 1814 | |
| 1815 | #define PROC_AUXV_MAX 256 /* Safety limit on auxv size. */ |
| 1816 |
no test coverage detected