sl@0: /*
sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: * All rights reserved.
sl@0: * This component and the accompanying materials are made available
sl@0: * under the terms of "Eclipse Public License v1.0"
sl@0: * which accompanies this distribution, and is available
sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: *
sl@0: * Initial Contributors:
sl@0: * Nokia Corporation - initial contribution.
sl@0: *
sl@0: * Contributors:
sl@0: *
sl@0: * Description: 
sl@0: *
sl@0: */
sl@0: #include <f32file.h>
sl@0: #include <fcntl.h>
sl@0: #include <errno.h>
sl@0: #include "dbus-bus.h"
sl@0: #include <dbus/config.h>
sl@0: #include <unistd.h> 
sl@0: 
sl@0: 
sl@0: extern "C"
sl@0: {
sl@0: 	
sl@0: void lock_file()
sl@0: {
sl@0: 					//code to lock the file 
sl@0: 					TBuf8<30>buf;
sl@0:    		 			buf.Copy((const TUint8 *)DBUS_LOCK_FILE);	
sl@0:    					TBuf16<30>buf16;
sl@0:    					buf16.Copy(buf);	
sl@0:     				RFs rf;
sl@0:     				User::LeaveIfError(rf.Connect());
sl@0:     				RFile fds;
sl@0:     				User::LeaveIfError(fds.Open(rf,buf16,EFileShareAny));
sl@0:     				fds.Lock(0,10);
sl@0: }
sl@0: 
sl@0: } //end extern "C"