linux/esptun.c
static void write_all(int fd, const uint8_t *buf, int n)
{
    int nwrite, left = n;

    while (left > 0) {
        if ((nwrite = write(fd, buf, left)) <= 0) {
            my_err("Writing data (%s)", strerror(errno));
        }
        left -= nwrite;
        buf += nwrite;
    }
}
/**
 * Ensures we write exactly n bytes. Exit in case of error or EOF.
 */
Ensures we write exactly n bytes. Exit in case of error or EOF.
Ensures we write exactly n bytes . Exit in case of error or EOF .
static void write_all(int fd, const uint8_t *buf, int n)
{
    int nwrite, left = n;
    while (left > 0) {
        if ((nwrite = write(fd, buf, left)) <= 0) {
            my_err("Writing data (%s)", strerror(errno));
        }
        left -= nwrite;
        buf += nwrite;
    }
}
static void write_all ( int fd , const uint8_t * buf , int n ) { int nwrite , left = n ; while ( left > 0 ) { if ( ( nwrite = write ( fd , buf , left ) ) <= 0 ) { my_err ( " " , strerror ( errno ) ) ; } left -= nwrite ; buf += nwrite ; } }
Ensures we write exactly n bytes.
Ensures we write exactly n bytes .