From mboxrd@z Thu Jan 1 00:00:00 1970 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.astral-os.org; s=s2026; t=1791223324; bh=W9qqE5nWP7NOZuh25arj/kl+5DqcPw1RZreRx3S+xZY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Help: List-Owner:List-Post:List-Subscribe:List-Unsubscribe:From; b=cj1JqnAZHvAE1wKJB6VJYTKw5VplKZwq5bVYOOKGni7rVjhwhyDDuN49BjIbk1Ojf hnjBq9SiXK4qcf5RH4GywpzAmdq3Cn5R7i0jzs/o/M3WbV7M4viEmW8D9EMmLvxVbp 5YcBByyRcvBl62HStlJzvn5pTQJH70kLxCCPR9GbjYU4nxTjjaroGhHfQduSClEjPf 4itzuOy6HeHhefx76RURuoFT3KLuvCdEOrC+tukYdrrAJf7KUknQGX+NUI2HN+kctU Uy0XgV2G0LKPHzFETGVxvaCCEX2CbylIv1Qipzt1kg8l0qVcto29Ncr04RG/wvrZNi hjEcmJsONNj6Q== Received: from vps-ace4d786.vps.ovh.us (localhost [127.0.0.1]) by mail.astral-os.org (Postfix) with ESMTP id 612FA3ECFC; Mon, 05 Oct 2026 18:02:04 +0000 (UTC) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=lists.astral-os.org; s=arc2026; t=1791223324; b=fG6nePgTqNpHm35zZ1ey4vy0NrQzQWafxu1Ip+0aRhMESJ5D84OjaMsMzCLCAW8k03lse E8LBMpXmjYY++Nc9jJbP/th+LKh3V4j0f9xmvGmN0ixvP/uwJo12JockTmkzR/9U8luoTsZ aSlKik14rTPRqT+e+Qcy6xWDFF0RSDqcQQnCLvkHcoD/VhlARX4Jiz9KGs2EabHJY6nzBIO MWPxpjVvAvd+ovaCW9J4FVg8iHYp38+aGRITIobWsDZJ4Nr6hgZYZQGft0PhB2iXH4x0541 5ufjIO9gMap5Wl+1ljJ/7APzQrm4rbWjJIjUUtvzITloX28JXekz4Z27XAlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.astral-os.org; s=arc2026; t=1791223324; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=M1NGq+9ij8wspkgwIzdq7ePwA2gKLwksIQrdvIi5cGI=; b=pMKABJSeWKqu2LJMXKVqRFSvP5uhK6pidN7GN6uyplSN1j1lqEjRr8Srw0G46lBeARhfP kE0DaRU9tzS11+KNnArVVMD+DT7lNpujsh2z3BhIgQsWvmrS1MqTp5zTYiPNeesaqmnHCwV 27Z+BrE2JW+j/1pjtodhHxzwZyWZ9OMkbB9pqXfwYFIdg+TCptTFJydV0GyCdQ0eyOcKQgj qYR18FuHRAfc7XXqswrU1bmEn/McfovrY6ro0VWXgwTuXuJAQslAb/Dy9+CEZ6QWA4M0lfj Ygf9iKXyroohCFfeOihrhrDkaBMOKbhCAiH0siJr1edolrMAfdbvg2l+StPw== ARC-Authentication-Results: i=1; lists.astral-os.org; dkim=pass header.d=astral-os.org; arc=none; dmarc=none Authentication-Results: lists.astral-os.org; dkim=pass header.d=astral-os.org; arc=none (Message is not ARC signed); dmarc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=astral-os.org; s=mail2026; t=1791223322; bh=W9qqE5nWP7NOZuh25arj/kl+5DqcPw1RZreRx3S+xZY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ni44Ek/G/7G40Sb0+1kqfZBCq0ZVaGHYiNC9L9NUghPWtA/luWPxrkb5wEk5tEsvv DHeJRWr+QDAXXHbd6lm19vpKfSHv8ZuEoO3B3bDFBnr9TPYc4VGxTVGQ+j5VudcKDh ZyEAgjCFTFuJO7c7Sgt4TP+GLQBlKZJg1zh2ebdXeiPXKrAybEWtAfmnf2b7YVFWnw 36vD1xRL9zNZ+YuKHL2Wq7hDdMGzVFUG6ZE4QG2RCRSbdL1E9yMOLvcFrZvWA4cyQP 0rF85YW5vt23qVCLDIs2EXcImYVG0vMZkboBb/PizgFw5lX9S9cYRtSYgKgBimMOmQ EIMbvTlCMy8pQ== Received: from LAPTOP-R01LEAQM.localdomain (unknown [200.146.247.68]) by mail.astral-os.org (Postfix) with ESMTPSA id D5FDB3ED03 for ; Mon, 05 Oct 2026 18:02:01 +0000 (UTC) From: Matheus To: astral-devel@lists.astral-os.org Subject: [PATCH 5/5] pty: use new anonymous devfs operations Date: Mon, 5 Oct 2026 15:01:52 -0300 Message-ID: <20261005180152.53359-6-matheus@astral-os.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261005180152.53359-1-matheus@astral-os.org> References: <20261005180152.53359-1-matheus@astral-os.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: OTEIOWI3RSTSFX3AA7FO6HWMOVKBVDFQ X-Message-ID-Hash: OTEIOWI3RSTSFX3AA7FO6HWMOVKBVDFQ X-MailFrom: matheus@astral-os.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Matheus Switch the old hacky way of registering a new pty master into using the new anonymous api. --- kernel-src/io/pty.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/kernel-src/io/pty.c b/kernel-src/io/pty.c index faa0f260..d9194bd8 100644 --- a/kernel-src/io/pty.c +++ b/kernel-src/io/pty.c @@ -261,25 +261,20 @@ static int open(int oldminor, vnode_t **vnode, int flags) { pty->minor = newminor; - char tmpname[20]; - snprintf(tmpname, 20, ".ptmx%d", newminor); - - // register a master device and immediatelly remove it from the filesystem and tables - // while holding the refcount - int error = devfs_register(&devops, tmpname, V_TYPE_CHDEV, DEV_MAJOR_PTY, newminor, 0, NULL); + int error = devfs_register_anonymous(&devops, V_TYPE_CHDEV, DEV_MAJOR_PTY, newminor, + 0, NULL, &pty->mastervnode); if (error) { freeptyminor(newminor); freepty(pty); return error; } - __assert(devfs_getbyname(tmpname, &pty->mastervnode) == 0); - - devfs_remove(tmpname, DEV_MAJOR_PTY, newminor); + devfs_remove_anonymous(DEV_MAJOR_PTY, newminor); // we are now the only ones to hold the master vnode and its inaccessible from devfs // create a pairing slave device + char tmpname[20]; snprintf(tmpname, 20, "pts/%d", newminor); pty->tty = tty_create(tmpname, writetopty, ttyinactive, NULL, hup_check, pty); if (pty->tty == NULL) { -- 2.43.0