Auto merge of #1350 - dbrgn:ttyname_r, r=gnzlbg
Auto merge of #1350 - dbrgn:ttyname_r, r=gnzlbg

Add ttyname_r

I hope this is correct. Parameter types taken from `man ttyname`.

```c
int ttyname_r(int fd, char *buf, size_t buflen);
```

rust-lang/libc,rust-lang/libc,rust-lang/libc