2 Unix SMB/CIFS implementation.
3 Test for fd passing with messaging
5 Copyright (C) Michael Adam 2014
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 #include "torture/proto.h"
23 #include "lib/util/tevent_unix.h"
29 * Try to pass an fd to the sending process - fails.
31 bool run_messaging_fdpass1(int dummy)
33 struct tevent_context *ev = NULL;
34 struct messaging_context *msg_ctx = NULL;
37 int pass_fds[1] = { 0 };
41 TALLOC_CTX *frame = talloc_stackframe();
43 ev = samba_tevent_context_init(frame);
45 fprintf(stderr, "tevent_context_init failed\n");
48 msg_ctx = messaging_init(ev, ev);
49 if (msg_ctx == NULL) {
50 fprintf(stderr, "messaging_init failed\n");
54 dst = messaging_server_id(msg_ctx);
58 perror("pipe failed");
62 pass_fds[0] = pipe_fds[0];
64 status = messaging_send_iov(msg_ctx, dst, MSG_PING, NULL, 0,
66 if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED)) {
68 "messaging_send_iov gave: %s\n", nt_errstr(status));