1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

Kernel: Make syscalls that take a buffer size use ssize_t instead of size_t.

Dealing with the unsigned overflow propagation here just seems unreasonably
error prone. Let's limit ourselves to 2GB buffer sizes instead.
This commit is contained in:
Andreas Kling 2019-02-25 21:19:57 +01:00
parent 5af4e622b9
commit beda478821
40 changed files with 144 additions and 136 deletions

View file

@ -10,8 +10,8 @@ class TTY : public CharacterDevice {
public:
virtual ~TTY() override;
virtual ssize_t read(Process&, byte*, size_t) override;
virtual ssize_t write(Process&, const byte*, size_t) override;
virtual ssize_t read(Process&, byte*, ssize_t) override;
virtual ssize_t write(Process&, const byte*, ssize_t) override;
virtual bool can_read(Process&) const override;
virtual bool can_write(Process&) const override;
virtual int ioctl(Process&, unsigned request, unsigned arg) override final;
@ -33,7 +33,7 @@ public:
void hang_up();
protected:
virtual ssize_t on_tty_write(const byte*, size_t) = 0;
virtual ssize_t on_tty_write(const byte*, ssize_t) = 0;
void set_size(unsigned short columns, unsigned short rows);
TTY(unsigned major, unsigned minor);