| 1705 | } |
| 1706 | |
| 1707 | S64 KProcess::llseek(FD fildes, S64 offset, U32 whence) { |
| 1708 | KFileDescriptorPtr fd = this->getFileDescriptor(fildes); |
| 1709 | S64 pos = 0; |
| 1710 | |
| 1711 | if (!fd) { |
| 1712 | return -K_EBADF; |
| 1713 | } |
| 1714 | if (whence==0) { // SEEK_SET |
| 1715 | pos = offset; |
| 1716 | } else if (whence==1) { // SEEK_CUR |
| 1717 | pos = fd->kobject->getPos(); |
| 1718 | if (pos<0) |
| 1719 | return pos; |
| 1720 | pos+=offset; |
| 1721 | } else if (whence==2) { // SEEK_END |
| 1722 | pos = fd->kobject->length(); |
| 1723 | if (pos<0) |
| 1724 | return pos; |
| 1725 | pos+=offset; |
| 1726 | } else { |
| 1727 | return -K_EINVAL; |
| 1728 | } |
| 1729 | return fd->kobject->seek(pos); |
| 1730 | } |
| 1731 | |
| 1732 | U32 writeRecord(KMemory* memory, U32 dirp, U32 len, U32 count, U32 pos, bool is64, const char* name, U32 id, U32 type) { |
| 1733 | U32 recordLen = 0; |
no test coverage detected