注) /dev/null ãããªã㦠/dev/full ã«é¢ããã¨ã³ããªã§ãã
/dev/full ã¯ä½ã§ãã?
write(2) ããã¨å¿ ã ENOSPC ãè¿ããã£ã©ã¯ã¿ããã¤ã¹ã§ãã
$ echo hello > /dev/full -bash: echo: write error: No space left on device
ãããããã°ããããªãã£ã©ã¯ã¿ããã¤ã¹ãã£ããªããã¨æã£ã¦ãLinux ã«ã¼ãã«ã®ã½ã¼ã¹ãèªã¿ç´ãã¾ãã
ChatGPT ã«èãã¦ã½ã¼ã¹ã調ã¹ã
grep ã GNU Global ã§ã·ã¥ã£ã¨è¦ã¤ãããªãã®ã§ãslack-gpt ã« ã«ã¼ãã«ã®ã½ã¼ã¹ãã©ããã¨èãããä¸çºã§æ£è§£ãåºãã¦ããã
ãã¡ãã slack-gpt ãæãã¦ããã URL ã§ã
/dev/full ã®ã½ã¼ã¹
/dev/full ã® write ãå¦çããã³ã¼ã㯠write_full
ã§ããã
static const struct file_operations full_fops = { .llseek = full_lseek, .read_iter = read_iter_zero, .write = write_full, ð¤ };
å¿ ã -ENOSPC ããããå®è£ ã«ãªã£ã¦ãã¾ãããããããã§ãã
static ssize_t write_full(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { return -ENOSPC; ð¤ }
ãªãã/dev/full ããã¤ã¹ã®å®ç¾©ã¯ä¸è¨ã®éããããã¤ã¹ã®åæåã³ã¼ãã¯é·ããªããããªã®ã§ ã¹ããã
static const struct memdev { const char *name; umode_t mode; const struct file_operations *fops; fmode_t fmode; } devlist[] = { #ifdef CONFIG_DEVMEM [DEVMEM_MINOR] = { "mem", 0, &mem_fops, FMODE_UNSIGNED_OFFSET }, #endif [3] = { "null", 0666, &null_fops, FMODE_NOWAIT }, #ifdef CONFIG_DEVPORT [4] = { "port", 0, &port_fops, 0 }, #endif [5] = { "zero", 0666, &zero_fops, FMODE_NOWAIT }, [7] = { "full", 0666, &full_fops, 0 }, ð¤ [8] = { "random", 0666, &random_fops, FMODE_NOWAIT }, [9] = { "urandom", 0666, &urandom_fops, FMODE_NOWAIT }, #ifdef CONFIG_PRINTK [11] = { "kmsg", 0644, &kmsg_fops, 0 }, #endif };
ææ³
- ã·ã³ãã«ãªå®è£ ã§é¢ç½ããèªåã§ãä½ããã
- ãã½ã¼ã¹èªãã ... ã§ãã©ãã ãã ...? ãã¨è¿·åã«ãªã£ãããChatGPT ã®ã¬ã¤ãã§ãã©ãçããã
åè
ð¡ slack-gpt ã¯ååã® På±±ãããéçºãã¦ãã ChatGPT Slack ãããã§ã