From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758063AbcCaWd4 (ORCPT ); Thu, 31 Mar 2016 18:33:56 -0400 Received: from mail.sigma-star.at ([95.130.255.111]:45996 "EHLO mail.sigma-star.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755647AbcCaWdy (ORCPT ); Thu, 31 Mar 2016 18:33:54 -0400 From: Richard Weinberger To: linux-kernel@vger.kernel.org Cc: linux-api@vger.kernel.org Subject: New syscall: leftpad() Date: Fri, 1 Apr 2016 00:33:31 +0200 Message-Id: <1459463613-32473-1-git-send-email-richard@nod.at> X-Mailer: git-send-email 2.7.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recent happenings in the node.js community showed how fragile software is when it comes to dependencies of fundamental algorithms like leftpad[1]. A node.js package which provided ledpad vanished and broke a lot of software. This raised our attention and we came to the conclusion that it is the kernel's job to provide such functionality such that node.js based applications can in future rely in Linux's "don't break userspace" rule. We hope that glibc and Andoid's bionic will soon offer wrapper functions for this new leftpad system call. We put leftpad into the kernel not only because of Linux's stable ABI, also for performance reasons. As everyone knows, within the kernel everything is faster and better. Leftpad has millions of users, so it has to be as fast as possible. This new system call will also help making services like left-pad.io[2] faster and more reliable. If the leftpad() system call gets adopted by a wider user base it might also make sense to add a generic npm() system call which acts like ioctl() where kernel modules can register new functions that are often used by node.js. Such functions might be, is_array(), is_int(), etc. Enjoy, //richard [1] http://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/ [2] http://left-pad.io/ [PATCH] Implement leftpad syscall [PATCH] leftpad.2: Document new syscall