From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932326AbcEKOaU (ORCPT ); Wed, 11 May 2016 10:30:20 -0400 Received: from qarx.de ([31.15.64.162]:51813 "EHLO a.mx.fefe.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932228AbcEKOaR (ORCPT ); Wed, 11 May 2016 10:30:17 -0400 X-Greylist: delayed 438 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 May 2016 10:30:16 EDT Date: Wed, 11 May 2016 16:22:51 +0200 From: Felix von Leitner To: LKML Subject: getting mysterious (to me) EINVAL from inotify_rm_watch Message-ID: <20160511142251.GA30812@qarx.de> Mail-Followup-To: LKML MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I am trying to add inotify support to my tail implementation (for -F). This is what happens: inotify_init() = 4 inotify_add_watch(4, "/tmp/foo", IN_MODIFY) = 1 inotify_rm_watch(4, 1) = -1 EINVAL (Invalid argument) inotify_add_watch(4, "/tmp/foo", IN_MODIFY) = 2 There is also some polling, some reading and some statting going on here, but those are on other descriptors than 4 so they should not matter). Can somebody explain the EINVAL I'm getting from inotify_rm_watch to me? This is a stock kernel 4.5.0. Thanks, Felix